Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0e8ebb9

Browse files
authored
fix: fix flaky TestWorkspaceProxy_Server_PrometheusEnabled (#12645)
1 parent2cd5fbc commit0e8ebb9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

‎enterprise/cli/proxyserver_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package cli_test
33
import (
44
"bufio"
55
"context"
6-
"errors"
76
"fmt"
87
"net/http"
98
"net/http/httptest"
@@ -76,7 +75,8 @@ func TestWorkspaceProxy_Server_PrometheusEnabled(t *testing.T) {
7675
_,_=w.Write([]byte(`{"app_security_key": "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789123456012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789123456"}`))
7776
return
7877
}
79-
ifr.URL.Path=="/api/v2/workspaceproxies/me/coordinate" {
78+
ifr.URL.Path=="/api/v2/workspaceproxies/me/coordinate"||
79+
r.URL.Path=="/api/v2/buildinfo" {
8080
// Slow down proxy registration, so that test runner can check if Prometheus endpoint is exposed.
8181
wg.Wait()
8282

@@ -107,8 +107,7 @@ func TestWorkspaceProxy_Server_PrometheusEnabled(t *testing.T) {
107107

108108
// Start "wsproxy server" command
109109
clitest.StartWithAssert(t,inv,func(t*testing.T,errerror) {
110-
assert.Error(t,err)
111-
assert.False(t,errors.Is(err,context.Canceled),"error was expected, but context was canceled")
110+
// actually no assertions are needed as the test verifies only Prometheus endpoint
112111
})
113112
pty.ExpectMatchContext(ctx,"Started HTTP listener at")
114113

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp