From 6093eb42652f327153f753ff0fe7ea5bc1f82481 Mon Sep 17 00:00:00 2001 From: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> Date: Wed, 2 Oct 2024 21:00:14 -0400 Subject: [PATCH] [chore] Fix Supervisor network tests on Windows (#35563) --- cmd/opampsupervisor/e2e_test.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cmd/opampsupervisor/e2e_test.go b/cmd/opampsupervisor/e2e_test.go index 18fcc4c17e3e..4ec5034f785e 100644 --- a/cmd/opampsupervisor/e2e_test.go +++ b/cmd/opampsupervisor/e2e_test.go @@ -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() @@ -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") + } }