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

Commit8923ce5

Browse files
authored
fix: fix flake in TestAppHealth_Healthy (#13607)
1 parent02ffff1 commit8923ce5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎agent/apphealth_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,16 @@ func TestAppHealth_Healthy(t *testing.T) {
5656
Health:codersdk.WorkspaceAppHealthInitializing,
5757
},
5858
}
59-
checks:=make(map[string]int)
59+
checks2:=0
60+
checks3:=0
6061
handlers:= []http.Handler{
6162
nil,
6263
http.HandlerFunc(func(w http.ResponseWriter,r*http.Request) {
63-
checks["app2"]++
64+
checks2++
6465
httpapi.Write(r.Context(),w,http.StatusOK,nil)
6566
}),
6667
http.HandlerFunc(func(w http.ResponseWriter,r*http.Request) {
67-
checks["app3"]++
68+
checks3++
6869
httpapi.Write(r.Context(),w,http.StatusOK,nil)
6970
}),
7071
}
@@ -109,8 +110,8 @@ func TestAppHealth_Healthy(t *testing.T) {
109110
require.Equal(t,codersdk.WorkspaceAppHealthHealthy,apps[2].Health)
110111

111112
// ensure we aren't spamming
112-
require.Equal(t,2,checks["app2"])
113-
require.Equal(t,1,checks["app3"])
113+
require.Equal(t,2,checks2)
114+
require.Equal(t,1,checks3)
114115
}
115116

116117
funcTestAppHealth_500(t*testing.T) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp