-
Notifications
You must be signed in to change notification settings - Fork 305
[ php-wasm ] Add test-unit-jspi
in CI workflow
#2285
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
Conversation
Well, only two |
this is a genuine failure
This can be disabled when we're running JSPI |
On it. |
Is anything missing here? |
I'm a bit skeptical since the pull request was resolved unusually smoothly, with only two minor issues. But, I think everything is in place. 😄 |
Haha sometimes things just work :) sort out the description and merge |
Well, I guess now we are talking about errors. |
I'd guess the asyncify tests in trunk were somehow adjusted to the multi-worker setup and JSPI tests in this branch were not. Resolving this may potentially be as easy as updating a config flag somewhere. |
@brandonpayton I certainly don't understand everything here so I wanted to know your opinion on this. I see in the
This is probably why when I run the tests in I also don't know where the |
## Motivation for the change, related issues #2231 overrides `FS.hashAddNode` with `function hashAddNodeIfNotSharedFS(node)` where additional logic applies if `is_shared_fs_node(node)` is true. Only NODEFS nodes were supposed to be considered as coming from a shared fs. Unfortunately, the internal logic of `is_shared_fs_node()` also returned true for MEMFS nodes. This caused a FS error 44 for the following operation where `runtime2` attempts to create a directory in a `/wordpress` directory mounted from `runtime1`: ```ts import { loadNodeRuntime } from "@php-wasm/node"; import { getLoadedRuntime } from "@php-wasm/universal"; const opts = { emscriptenOptions: { ENV: { DOCROOT: '/wordpress' } } }; const runtime1 = getLoadedRuntime(await loadNodeRuntime('8.3', opts)); runtime1.FS.mkdir("/wordpress"); const runtime2 = getLoadedRuntime(await loadNodeRuntime('8.3', opts)); runtime2.FS.mkdir("/wordpress"); runtime2.FS.mount( runtime2.PROXYFS, { root: '/wordpress', fs: runtime1.FS }, '/wordpress' ); // This works: // runtime1.FS.mkdir("/wordpress/wp-content"); // This doesn't: runtime2.FS.mkdir("/wordpress/wp-content"); ``` Specifically, the FS error 44 was triggered inside `is_shared_fs_node()` when calling NODEFS operations on these non-NODEFS nodes. ## Implementation details Adds a check confirming the shared node comes from NODEFS. ## Testing Instructions (or ideally a Blueprint) * Confirm the reproduction above works without errors. * Once #2285 lands, we'll be able to add a unit test cc @brandonpayton
test-unit-jspi
in CI workflowtest-unit-jspi
in CI workflow
e035bc0
to
eac6b14
Compare
afbf20f
to
9f02bfc
Compare
This looks good, it only needs a rebase |
Yep! I am on it. I've separated the global tests from the
They now have their own dedicated job. |
@adamziel You approved this pull request two weeks ago, before many changes. Do you still approve it? Can I squash and merge? |
Motivation for the change, related issues
Based on this comment
This enables the JSPI mode tests alongside
test-unit-asyncify
in CI workflow.Implementation details
Duplication of the
test-unit-asyncify
tests. With two major differences :php
runtime withphp.exit()
after each test.Testing Instructions (or ideally a Blueprint)
CI