.github/workflows: update wasmbrowsertest to fix timeout issue

Updates #1313
This commit is contained in:
Hajime Hoshi 2024-08-02 15:27:53 +09:00
parent 1fc2dedaaa
commit 5d7c3f754b
4 changed files with 1 additions and 28 deletions

View File

@ -44,7 +44,7 @@ jobs:
- name: Install wasmbrowsertest - name: Install wasmbrowsertest
run: | run: |
wasmbrowsertest_version=6e494bb3a5ddfe6cccb449250dbdcaa5777b593d wasmbrowsertest_version=2c08e5b313d11223b7d68e14ec280b00e7341ac3
go install github.com/agnivade/wasmbrowsertest@${wasmbrowsertest_version} go install github.com/agnivade/wasmbrowsertest@${wasmbrowsertest_version}
mv $(go env GOPATH)/bin/wasmbrowsertest${{ runner.os == 'Windows' && '.exe' || '' }} $(go env GOPATH)/bin/go_js_wasm_exec${{ runner.os == 'Windows' && '.exe' || '' }} mv $(go env GOPATH)/bin/wasmbrowsertest${{ runner.os == 'Windows' && '.exe' || '' }} $(go env GOPATH)/bin/go_js_wasm_exec${{ runner.os == 'Windows' && '.exe' || '' }}
go install github.com/agnivade/wasmbrowsertest/cmd/cleanenv@${wasmbrowsertest_version} go install github.com/agnivade/wasmbrowsertest/cmd/cleanenv@${wasmbrowsertest_version}

View File

@ -17,7 +17,6 @@ package audio_test
import ( import (
"bytes" "bytes"
"io" "io"
"os"
"runtime" "runtime"
"testing" "testing"
"time" "time"
@ -36,14 +35,6 @@ func teardown() {
context = nil 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 // Issue #746
func TestGC(t *testing.T) { func TestGC(t *testing.T) {
setup() setup()

View File

@ -18,22 +18,12 @@ import (
"bytes" "bytes"
"io" "io"
"math/rand" // TODO: Use math/rand/v2 when the minimum supported version becomes Go 1.22. "math/rand" // TODO: Use math/rand/v2 when the minimum supported version becomes Go 1.22.
"os"
"testing" "testing"
"time"
"unsafe" "unsafe"
"github.com/hajimehoshi/ebiten/v2/audio/internal/convert" "github.com/hajimehoshi/ebiten/v2/audio/internal/convert"
) )
func TestMain(m *testing.M) {
code := m.Run()
// Tests in this package often fails on GitHub Actions due to unfinished goroutines.
// That's mysterious, but to avoid this, sleep for a while before exiting.
time.Sleep(200 * time.Millisecond)
os.Exit(code)
}
func randInt16s(n int) []int16 { func randInt16s(n int) []int16 {
r := make([]int16, n) r := make([]int16, n)
for i := range r { for i := range r {

View File

@ -21,7 +21,6 @@ import (
"runtime" "runtime"
"strings" "strings"
"testing" "testing"
"time"
"github.com/hajimehoshi/ebiten/v2/internal/shader" "github.com/hajimehoshi/ebiten/v2/internal/shader"
"github.com/hajimehoshi/ebiten/v2/internal/shaderir" "github.com/hajimehoshi/ebiten/v2/internal/shaderir"
@ -30,13 +29,6 @@ import (
"github.com/hajimehoshi/ebiten/v2/internal/shaderir/msl" "github.com/hajimehoshi/ebiten/v2/internal/shaderir/msl"
) )
func TestMain(m *testing.M) {
code := m.Run()
// The Wasm tests on GitHub CI often fail due to some remaining functions. Wait for a while to finish them.
time.Sleep(100 * time.Millisecond)
os.Exit(code)
}
func glslVertexNormalize(str string) string { func glslVertexNormalize(str string) string {
p := glsl.VertexPrelude(glsl.GLSLVersionDefault) p := glsl.VertexPrelude(glsl.GLSLVersionDefault)
if strings.HasPrefix(str, p) { if strings.HasPrefix(str, p) {