Skip to content

Commit

Permalink
[chore] Fix Supervisor network tests on Windows (open-telemetry#35563)
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-bradley authored and jriguera committed Oct 4, 2024
1 parent 2be8a43 commit 6093eb4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cmd/opampsupervisor/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,12 @@ func TestSupervisorStartsWithNoOpAMPServer(t *testing.T) {
// Verify the collector is not running after 250 ms by checking the healthcheck endpoint
time.Sleep(250 * time.Millisecond)
_, err := http.DefaultClient.Get("http://localhost:12345")
require.ErrorContains(t, err, "connection refused")

if runtime.GOOS != "windows" {
require.ErrorContains(t, err, "connection refused")
} else {
require.ErrorContains(t, err, "No connection could be made")
}

// Start the server and wait for the supervisor to connect
server.start()
Expand Down Expand Up @@ -1341,7 +1346,11 @@ func TestSupervisorStopsAgentProcessWithEmptyConfigMap(t *testing.T) {
// Verify the collector is not running after 250 ms by checking the healthcheck endpoint
time.Sleep(250 * time.Millisecond)
_, err := http.DefaultClient.Get("http://localhost:12345")
require.ErrorContains(t, err, "connection refused")
if runtime.GOOS != "windows" {
require.ErrorContains(t, err, "connection refused")
} else {
require.ErrorContains(t, err, "No connection could be made")
}

}

Expand Down

0 comments on commit 6093eb4

Please sign in to comment.