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:
Hajime Hoshi 2025-02-01 14:10:37 +09:00
parent 26eafc6f3a
commit 3a1eeabff1

View File

@ -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) {