syscall/js: wasm compiled tests not running in browser after async operations change #28068
Labels
arch-wasm
WebAssembly issues
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version devel +165ebaf97b Sun Oct 7 02:36:02 2018 +0000 linux/amd64
Does this issue reproduce with the latest release?
yes
What did you do?
I tried to run tests from standard library in the browser. See #26051 for more context. But after 0e4c013 was checked in, the tests seem to hang and not run.
Here is how to repro -
Take the html and wasm_exec.js from GOROOT/misc/wasm/. Change the
writeSync
andopenSync
functions towrite
andopen
inglobal.fs
in wasm_exec.js. (That is another thing we need to fix).Compile any test to a binary -
/go/src/encoding$GOOS=js GOARCH=wasm gotip test -run=^TestDecode -o hex.wasm -c -v ./hex/
Update your index.html to pass the args after getting the go object.
go.argv = ['-test.run=TestDecode', '-test.v=true'];
Try to run the test, by copying over the binary to your other folder and press the run button.
What did you expect to see?
I expect it to run all the tests
What did you see instead?
Only the first test was started, but then after that nothing else is running
But if I revert this commit
and compile and run again, all tests run (also including the ones not in my
test.run
pattern, which seems to be another issue). Make sure you have the writeSync and openSync functions again, not write and open. Or rather duplicate them so that it's easy to test.@neelance @bradfitz
Is this issue in syscall side or wasm_exec side ? I am not very clear on that. But there is clearly something which changed with this commit, that is preventing the tests from running.
The text was updated successfully, but these errors were encountered: