diff --git a/enterprise/cli/proxyserver_test.go b/enterprise/cli/proxyserver_test.go index 71aa4e02941fb..1af78b4b134ec 100644 --- a/enterprise/cli/proxyserver_test.go +++ b/enterprise/cli/proxyserver_test.go @@ -3,7 +3,6 @@ package cli_test import ( "bufio" "context" - "errors" "fmt" "net/http" "net/http/httptest" @@ -76,7 +75,8 @@ func TestWorkspaceProxy_Server_PrometheusEnabled(t *testing.T) { _, _ = w.Write([]byte(`{"app_security_key": "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789123456012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789123456"}`)) return } - if r.URL.Path == "/api/v2/workspaceproxies/me/coordinate" { + if r.URL.Path == "/api/v2/workspaceproxies/me/coordinate" || + r.URL.Path == "/api/v2/buildinfo" { // Slow down proxy registration, so that test runner can check if Prometheus endpoint is exposed. wg.Wait() @@ -107,8 +107,7 @@ func TestWorkspaceProxy_Server_PrometheusEnabled(t *testing.T) { // Start "wsproxy server" command clitest.StartWithAssert(t, inv, func(t *testing.T, err error) { - assert.Error(t, err) - assert.False(t, errors.Is(err, context.Canceled), "error was expected, but context was canceled") + // actually no assertions are needed as the test verifies only Prometheus endpoint }) pty.ExpectMatchContext(ctx, "Started HTTP listener at")