-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error if there are pending items on the event queue #277
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For when we release: Would you consider this a major change?
testFile: "upstream/encoding/replacement-encodings.any.js", | ||
}, | ||
// { // FIXME requires the event loop | ||
// testFile: "upstream/encoding/replacement-encodings.any.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unclear to me why this was needed to be commented out, could you clarify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually doesn't need to be commented out any more since I disabled the error message with pending jobs. Technically the tests aren't completing properly but I can't figure out a way to have these tests error but have the suite setup to not cause a panic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this does need to continue to be commented out or we get unhandled promise rejections due to Javy not implementing XMLHttpRequest
when we run with the event loop enabled. I've updated the comment.
wpt/package.json
Outdated
@@ -6,7 +6,7 @@ | |||
"scripts": { | |||
"bundle": "rollup -c rollup.config.js runner.js", | |||
"javy": "../target/release/javy compile -o bundle.wasm bundle.js", | |||
"wasmtime": "wasmtime bundle.wasm", | |||
"wasmtime": "wasmtime --env JAVY_WPT=1 bundle.wasm", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know much about how the wpt
stuff is built and ran yet but could we run it with the experimental_event_loop
feature turned on? Would that help avoid needing to pass and checking this JAVY_WPT
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to address that in #277 (comment). The short answer is yes, but I'd prefer to not do that because WPT would be testing something that doesn't behave like Javy would without the feature enabled.
We can bump the minor version since we're 0.x. JS code that was working could stop working if it created pending jobs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; thanks for all your patience iterating on this!
We've received feedback that the current behaviour of successfully exiting when items there are items enqueued on to the event loop that will never be executed is unexpected and they would prefer if the execution trapped with a helpful error message instead. This PR:
is_pending
toContext
to return whether there are pending jobs on the event queueThe check if we're running the WPT suite is done through a WASI environment variable. I opted to use this approach because:
I did take a look at the benchmarks to see if the WASI call to retrieve the env var value would have a performance impact and the results indicated no change in performance between main and this branch.