Fix small timeout causing test flake (#5436)

This commit is contained in:
Joe Kralicky 2025-01-21 14:31:34 -05:00 committed by GitHub
parent 396c35b6b4
commit b674d5c19d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -145,13 +145,9 @@ func TestSpanObserver(t *testing.T) {
obs.Observe(Span(1).ID()) obs.Observe(Span(1).ID())
startTime := time.Now() assert.Eventually(t, func() bool {
for waitersExited.Load() != 10 { return waitersExited.Load() == 10
if time.Since(startTime) > 1*time.Millisecond { }, 10*time.Millisecond, 1*time.Millisecond)
t.Fatal("timed out")
}
runtime.Gosched()
}
}) })
} }