mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-04 15:04:28 +01:00
audio: fix test flakiness
This test could fail on Windows, though this is pretty rare. https://github.com/hajimehoshi/ebiten/actions/runs/13085345903/job/36515771792 ``` === RUN TestSameSourcePlayers audio_test.go:98: got: nil, want: an error ```
This commit is contained in:
parent
26eafc6f3a
commit
3a1eeabff1
@ -94,9 +94,14 @@ func TestSameSourcePlayers(t *testing.T) {
|
|||||||
p0.Play()
|
p0.Play()
|
||||||
p1.Play()
|
p1.Play()
|
||||||
|
|
||||||
if err := audio.UpdateForTesting(); err == nil {
|
for i := 0; i < 10; i++ {
|
||||||
t.Errorf("got: nil, want: an error")
|
if err := audio.UpdateForTesting(); err != nil {
|
||||||
|
// An error is expected.
|
||||||
|
return
|
||||||
|
}
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
t.Errorf("time out")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPauseBeforeInit(t *testing.T) {
|
func TestPauseBeforeInit(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user