-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Disable NODERAWFS tests on Mac #6121
Disable NODERAWFS tests on Mac #6121
Conversation
Also add support for platform-dependent tests.
I would say that we add/modify conditional preprocessing on the failing unistd test. I think there already is one... |
We have a couple of platform guards here, can we fix them instead of just disabling failing tests? |
Those The reason is, in clang, WebAssembly (for Wasm backend) and Emscripten (for fastcomp) have a separate OS target, so when we give Rather, emscripten predefines So, in short, OS-related macros like Maybe good to cc people in those old issues as well: @kripken @juj @jgravelle-google @dschuff |
Hmm, we may have to accept multiple error numbers as expected without conditions.
|
Emscripten shouldn't define OS-dependent things like
Practically speaking, even if we want to do 1, we may or may not need a way for the API's implementation to tell what platform it's on, but it would be hidden from the user. Short-term, it probably makes sense to disable the tests wherever they don't work for now. |
There are many conditional guards like |
In principle they probably shouldn't be there, and in practice they don't do anything, so it seems like they should probably be removed, (depending on what they are there for, e.g. if they came from third-party code or something). As for this PR specifically, do we want to duplicate or replace the OS detection logic from shared.py? I get that we need |
@dschuff The We have three options:
If we go with the option 1 as I am currently doing, I think separating it with two PRs might make more sense too, as you suggested:
|
Is the issue here just the error codes? If so, can we do what @saschanaz suggested above,
or is the OS-specific behavior more complicated to work around in the test? |
@kripken If we are already disabling windows by this code, wouldn't disabling mac in the same manner, within this |
Split decorator part in #6128, which should land first. |
Yeah, if we already have an if for Windows, we can add Mac to there too. |
I skipped Windows because permission bits are simply not supported on Windows and all chmod tests were broken. |
BTW, can we file an issue on Nodejs (or possibly libuv) side?
It seems (Unfortunately I don't have any macOS access) |
@saschanaz Are you referring to me in regards to the Nodejs issue? |
Yes, but feel free to ignore if you don't have free time or you only have bot access for macOS tests... |
Sorry, I don't have much background on Node, so I'm not sure if I can provide sufficient context there. |
Oops, never mind then, sorry! |
@saschanaz That's documented at https://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback:
You need to create the file if it doesn't exist, open as 'r+', and then manually seek to the end. [Edit]: oh wait, you're talking about MacOS. Maybe it's the same though? |
IMO that 'positional writes' means giving explicit position argument, whereas our writeFile test expects the append mode automatically sets the position to the EOF. |
tests/test_core.py
Outdated
@@ -4564,6 +4564,7 @@ def test_fs_trackingdelegate(self): | |||
out = path_from_root('tests', 'fs', 'test_trackingdelegate.out') | |||
self.do_run_from_file(src, out) | |||
|
|||
@no_mac('NODERAWFS support on mac is flaky') |
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 also disables the non-NODERAWFS part on mac. i guess there isn't a simple way to disable just that part, though, unless we split up this test. not sure it's important enough to justify that.
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 split the test into two.
tests/test_core.py
Outdated
# disable test_fs_writeFile test, so we split the test into two. | ||
# See issue 6121 | ||
@no_osx('NODERAWFS support on OSX is flaky') | ||
@also_with_noderawfs |
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 think that on non-mac this will run the test twice without NODERAWFS and once with it? (since test_fs_writeFile_noderawfs
is marked as also_with_noderawfs
which will run it once normally and once with NODERAWFS)
Seems a little wasteful, but there isn't a good and obvious way to fix it. Best I can think of is: go back to what we had before, and in the test check if mac and is_noderawfs
, and if so skip that test (I think we need to add a method to check is_noderawfs
).
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.
Not sure if I can check that, because I guess the way to implement is_noderawfs
would be to check if Settings.NODERAWFS == 1
. But that is true only in the child process this test_core.py launches with option -s NODERAWFS=1
and not in test_core.py.
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.
Hmm, yes, I think we would need to check something like 'NODERAWFS=1' in self.emcc_args
.
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.
Done
tests/test_core.py
Outdated
@@ -4566,6 +4566,9 @@ def test_fs_trackingdelegate(self): | |||
|
|||
@also_with_noderawfs | |||
def test_fs_writeFile(self, js_engines=None): | |||
if self.is_osx() and 'NODERAWFS=1' in self.emcc_args: |
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.
Too bad to miss reviewing #6128, but can we rename is_osx
to is_macos
, as Apple renamed OS X to macOS to keep consistency with iOS, watchOS and tvOS?
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.
Done in #6138, which should land first.
Now the only thing left is the unlink test. Can you check what errno the test emits on line 90 of tests/unistd/unlink.c, and if possible allow it like this?
|
Even if we do that, the assertion on the line 157 fails too; the errno in this case is It would look kind of weird if we change that code into
when there is no case the How about wrapping up this PR here and deleting all |
Maybe someone wanted to thoroughly check native gcc/clang behavior, but 👍 for removing |
NODERAWFS support added by #6008 seems to be still flaky on Mac. (Not sure about Windows. Out waterfall bots have other problems at the moment so they can't test this)
Also add support for platform-dependent tests.