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

Commit695afb8

Browse files
authored
fix: address TestPendingUpdatesMetric flake
1 parent966c888 commit695afb8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎coderd/notifications/metrics_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,10 @@ func TestPendingUpdatesMetric(t *testing.T) {
254254
success:=testutil.RequireRecvCtx(testutil.Context(t,testutil.WaitShort),t,interceptor.updateSuccess)
255255
failure:=testutil.RequireRecvCtx(testutil.Context(t,testutil.WaitShort),t,interceptor.updateFailure)
256256

257-
// Ensure that the value set in the metric is equivalent to the number of actual pending updates.
258-
pending:=promtest.ToFloat64(metrics.PendingUpdates)
259-
require.EqualValues(t,pending,success+failure)
257+
// Wait for the metric to be updated with the expected count of metrics.
258+
require.Eventually(t,func()bool {
259+
returnpromtest.ToFloat64(metrics.PendingUpdates)==float64(success+failure)
260+
},testutil.WaitShort,testutil.IntervalFast)
260261

261262
// Unpause the interceptor so the updates can proceed.
262263
interceptor.unpause()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp