Skip to content

Commit

Permalink
audio: fix test flakiness
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
hajimehoshi committed Feb 1, 2025
1 parent 26eafc6 commit 3a1eeab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions audio/audio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,14 @@ func TestSameSourcePlayers(t *testing.T) {
p0.Play()
p1.Play()

if err := audio.UpdateForTesting(); err == nil {
t.Errorf("got: nil, want: an error")
for i := 0; i < 10; i++ {
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) {
Expand Down

0 comments on commit 3a1eeab

Please sign in to comment.