Open hajimehoshi opened 3 months ago
Specifying -test.paniconexit0=false
explicitly fixed the issue, but I was wondering why...
@hajimehoshi - It seems like calling os.Exit(0)
from within your tests is incorrect: https://tip.golang.org/doc/go1.16#go-test
Is the question about why is there an Uncaught TypeError: Cannot read properties of undefined
, or why does the panic happen? Because the latter seems expected, and the uncaught error seems like a side effect of the os.Exit
. Preventing the os.Exit(0)
should prevent this altogether, unless you want me to investigate about the uncaught error?
The test failed even without calling os.Exit(0)
in my packages
https://github.com/hajimehoshi/ebiten/actions/runs/10651168008/job/29523427131
panic: unexpected call to os.Exit(0) during test
goroutine 1 [running]:
os.Exit(0x0)
/opt/hostedtoolcache/go/1.20.14/x64/src/os/proc.go:67 +0x8
main.main()
_testmain.go:54 +0x53
http://127.0.0.1:32895/wasm_exec.js:535:10 Uncaught
Error: Go program has already exited
at globalThis.Go._resume (http://127.0.0.1:32895/wasm_exec.js:536:11)
at http://127.0.0.1:32895/wasm_exec.js:264:14
exit with status 2
Is the question about why is there an Uncaught TypeError: Cannot read properties of undefined, or why does the panic happen?
My question is why the panic happens. The panic started to happen wihtout changing anything on my side so this was mysterious. I am not sure where is the culprit is, but I wanted to share this situation.
Isn't the flag -test.paniconexit0
false by default by the way?
you want me to investigate about the uncaught error?
If you have any insights, I'd be happy if you could invetigate this. Otherwise, we can close this issue. -test.paniconexit0=false
suppress this issue anyway.
My question is why the panic happens. The panic started to happen wihtout changing anything on my side so this was mysterious.
The panic must happen from an os.Exit(0)
call somewhere. There is nowhere I call os.Exit
from within wasmbrowsertest. Only in cleanEnv
there is a possibility, but it's not part of a test.
Nevertheless, I'll take a look at the exception when I get some time.
This value is false by default so os.Exit(0)
should not cause this issue by default, IIUC.
Is wasm_exec.js version matched correctly? This has changed a bit in 1.23.
The current Go version's wasm_exec.js should be used.
I'm wondering if this problem still exists with the latest codebase and Go versions? I suspect it may be a runtime issue. Is there a command that will allow me to reproduce this error immediately?
AFAIR, This happens only in GitHub Actions, so it is pretty tricky to reproduce the issue.
This does make things much more troublesome now, and I shouldn't have much time to work on this lately.
Does using the go_js_wasm_exec
script that comes with go trigger this issue? If it does, please create an issue in golang/go
I am not sure this is an issue in wasmbrowsertest, but let me share the issue.
https://github.com/hajimehoshi/ebiten/actions/runs/10651026325/job/29523110919