mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
audio: bug fix: reduce test flakiness
This commit is contained in:
parent
1d75c9e967
commit
09cac12390
@ -16,6 +16,7 @@ package audio_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
@ -34,6 +35,14 @@ func teardown() {
|
||||
context = nil
|
||||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
code := m.Run()
|
||||
// 200[ms] should be enough all the players are consumed.
|
||||
// TODO: This is a dirty hack. Would it be possible to use virtual time?
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
// Issue #746
|
||||
func TestGC(t *testing.T) {
|
||||
setup()
|
||||
@ -138,8 +147,4 @@ func TestNonSeekableSource(t *testing.T) {
|
||||
|
||||
p.Play()
|
||||
p.Pause()
|
||||
|
||||
// 200[ms] should be enough all the bytes are consumed.
|
||||
// TODO: This is a dirty hack. Would it be possible to use virtual time?
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user