We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab65611 commit 46784c7Copy full SHA for 46784c7
logging/telemetryhook_test.go
@@ -225,5 +225,10 @@ func TestAsyncTelemetryHook_QueueDepth(t *testing.T) {
225
close(filling)
226
hook.Close()
227
228
- require.Equal(t, maxDepth, len(testHook.entries()))
+ hookEntries := len(testHook.entries())
229
+ require.GreaterOrEqual(t, hookEntries, maxDepth)
230
+ // the anonymous goroutine in createAsyncHookLevels might pull an entry off the pending list before
231
+ // writing it off to the underlying hook. when that happens, the total number of sent entries could
232
+ // be one higher then the maxDepth.
233
+ require.LessOrEqual(t, hookEntries, maxDepth+1)
234
}
0 commit comments