Repository navigation
Emscripten: Get test suite passing #127146
Copy link
Copy link
Closed
Labels
Description
First I'd like to get the test suite to run all the way through, then to pass.
Update 2025/01/30
Emscripten 4.0.2 has fixes for all of the file system bugs I've looked into. There are still problems with nonblocking I/O which I haven't looked into.
Emscripten PRs:
- Make seek work on
/dev/nullemscripten-core/emscripten#22886
Make readlink system call not resolve the link emscripten-core/emscripten#23000
Trying to create a directory in a file should return ENOTDIR not EPERM emscripten-core/emscripten#23025
Refactor lookupPath to avoid recursion. NFC emscripten-core/emscripten#23017
Fix path resolution for symlinks emscripten-core/emscripten#23072
Make readdir on /proc/self/fd work emscripten-core/emscripten#23073
Add nodefs readdir handling for directories that contain exotic entries emscripten-core/emscripten#22925
Make fstat work on file descriptor with no name emscripten-core/emscripten#23058
When opening broken symlink with O_CREAT, create file at target emscripten-core/emscripten#23002
JS file system: distinguish between atime, mtime, and ctime emscripten-core/emscripten#22998
Fix renaming a file on top of an existing file in memfs and nodefs emscripten-core/emscripten#23074
Handle trailing % in strftime emscripten-core/emscripten#23045
Add wcsftime from musl. NFC emscripten-core/emscripten#23061
Return EISDIR when trying to create a path ending in / with open emscripten-core/emscripten#23135
Fixmkdir("a/b/..")should returnEEXISTemscripten-core/emscripten#23136
Make open O_CREATE mode 0 work emscripten-core/emscripten#23137
Ensure the ino we give to readdir matches the ino we give to stat emscripten-core/emscripten#23139
Correctly handle calls setting timestamp to 0 emscripten-core/emscripten#23310
Raise ENOSYS if AT_SYMLINK_NOFOLLOW is used with chmod or chown in nodefs emscripten-core/emscripten#23307
[FS] Allow pipes to be stat'ed emscripten-core/emscripten#23306
[FS] lookupPath should throw an error on an empty string emscripten-core/emscripten#23366
[FS] Make fstat work on file descriptors with no name in node rawfs emscripten-core/emscripten#23364
[FS] Make fstatfs actually work emscripten-core/emscripten#23381
[FS] Make fstat work on file descriptors with no name in memfs emscripten-core/emscripten#23470
[FS] Make fstat work on file descriptors with no name in nodefs emscripten-core/emscripten#23480
JS FS: Don't return ELOOP on a path with a large number of ..'s emscripten-core/emscripten#24591
Looking up ip for localhost should return 127.0.0.1 emscripten-core/emscripten#24593
Linked PRs
- gh-127146: Emscripten: Skip segfaults in test suite #127151
- gh-127146: Mark test_bz2 tests with requires_subprocess #127562
- gh-127146: Resolve some minor problems in Emscripten tests #127565
- gh-127146: Some expected failures in Emscripten time tests #127843
- gh-127146: Emscripten clean up test suite #127984
- gh-127146: Emscripten Include compiler version in _PYTHON_HOST_PLATFORM #127992
- gh-127146: Fix test_sysconfidata_json in Emscripten #128545
- gh-127146: skip Emscripten tests with pending fixes #128549
- gh-127146: Fix test_sysconfigdata_json for Emscripten #128556
- gh-127146: Strip dash from Emscripten compiler version #128557
- gh-127146: Update test skips for Emscripten 4.0.1 #129375
- gh-127146: Skip test_readinto_non_blocking on Emscripten #129421
- gh-127146: Don't compare userbase in test_sysconfig_json #129422
- gh-127146: Update test skips for Emscripten 4.0.2 #129474
- gh-127146: Fix Emscripten build with --pydebug #131672
- gh-127146: Fix Emscripten test suite when run with -uall #132092
- gh-127146: xfail more Emscripten stack overflows #134358
- [3.14] gh-127146: xfail more Emscripten stack overflows (GH-134358) #134382
- gh-127146: Allow ignored keys to be missing in test_sysconfig #135622
- gh-127146: Emscripten: Fix pathlib glob_dotdot test #135624
- gh-127146: Emscripten: Fix test failure due to missing os.link #135626
- gh-127146: Emscripten: Skip test_url2pathname_resolve_host #135634
- gh-127146: Enable large files on Emscripten #135635
- [3.14] gh-127146: Allow ignored keys to be missing in test_sysconfig (GH-135622) #135650
- [3.14] gh-127146: Emscripten: Skip test_url2pathname_resolve_host (GH-135634) #135651
- [3.14] gh-127146: Emscripten: Fix test failure due to missing os.link (GH-135626) #135652
- [3.14] gh-127146: Emscripten: Fix pathlib glob_dotdot test (GH-135624) #135653
- [3.14] gh-127146: Enable large files on Emscripten (GH-135635) #135655
- gh-127146: Add skip_emscripten_stack_overflow in a few places #135722
- [3.14] gh-127146: Add skip_emscripten_stack_overflow in a few places (GH-135722) #135733
- gh-127146: Skip test_os.test_mode for Emscripten #135764
- [3.14] gh-127146: Skip test_os.test_mode for Emscripten (GH-135764) #135784
- gh-127146: Skip test_netrc.test_security on Emscripten #136227
- gh-127146: Report uid in Emscripten + node as native uid #136509
- gh-127146: Skip test_open_undecodable_uri on Emscripten #136510
- gh-127146: Emscripten: Fix test_open_undecodable_uri by setting
-sTEXTDECODER=2#136624 - [3.14] gh-127146: Emscripten: Fix test_open_undecodable_uri by setting
-sTEXTDECODER=2(GH-136624) #136631 - [3.14] gh-127146: Report uid in Emscripten + node as native uid (GH-136509) #136699
- gh-127146: Emscripten: Make os.umask() actually work #136706
- gh-127146: Emscripten: Don't need to avoid unpaired surrogate anymore #136707
- gh-127146: Emscripten: more regular stack overflow skips #136708
- [3.14] gh-127146: Emscripten: Make os.umask() actually work (GH-136706) #136711
- [3.14] gh-127146: Emscripten: more regular stack overflow skips (GH-136708) #136712
- [3.14] gh-127146: Emscripten: Don't need to avoid unpaired surrogate anymore (GH-136707) #136717
- gh-127146: Emscripten: Set umask to zero in test_apropos_empty_doc #136740
- [3.14] gh-127146: Emscripten: Set umask to zero in python.sh (GH-136740) #136745
- gh-127146: Emscripten: Add test_sample_profiler skips where needed #137815
Reactions are currently unavailable
Activity
pythongh-127146: Emscripten Include compiler version in _PYTHON_HOST_…
gh-127146: Emscripten clean up test suite (#127984)
gh-127146: Emscripten Include compiler version in _PYTHON_HOST_PLATFO…
pythongh-127146: Fix test_sysconfidata_json in Emscripten
pythongh-127146: Fix test_sysconfidata_json in Emscripten
pythongh-127146: skip some tests that are fixed on the main branch of…
pythongh-127146: Fix test_sysconfigdata_json for Emscripten
pythongh-127146: Strip dash from Emscripten compiler version
gh-127146: Fix test_sysconfigdata_json for Emscripten (#128556)
gh-127146: Skip Emscripten tests with pending fixes (#128549)
gh-127146: Strip dash from Emscripten compiler version (#128557)
pythongh-127146: Resolve some minor problems in Emscripten tests (pyt…
pythongh-127146: Emscripten: Skip segfaults in test suite (python#127151
pythongh-127146: Some expected failures in Emscripten time tests (pyt…
pythongh-127146: Emscripten clean up test suite (python#127984)
pythongh-127146: Emscripten Include compiler version in _PYTHON_HOST_…
pythongh-127146: Fix test_sysconfigdata_json for Emscripten (python#1…
pythongh-127146: Skip Emscripten tests with pending fixes (python#128549
pythongh-127146: Strip dash from Emscripten compiler version (python#…
pythongh-127146: Update test skips for Emscripten 4.0.1
gh-127146: Update test skips for Emscripten 4.0.1 (#129375)
pythongh-127146: Skip test_readinto_non_blocking on Emscripten
pythongh-127146: Don't compare userbase in test_sysconfig_json
pythongh-127146: Don't compare userbase in test_sysconfig_json
gh-127146: Skip test_readinto_non_blocking on Emscripten (#129421)
pythongh-127146: Update test skips for Emscripten 4.0.2
Remove test skips no longer needed on Emscripten 3.1.74 (#5417)
gh-127146: Update test skips for Emscripten 4.0.2 (#129474)
pythongh-127146: Update test skips for Emscripten 4.0.2 (python#129474)
pythongh-127146: Fix Emscripten build with --pydebug
gh-127146: Fix Emscripten build with --pydebug (#131672)
pythongh-127146: Fix Emscripten build with --pydebug (python#131672)
pythongh-127146: Fix Emscripten test suite when run with -uall
pythongh-127146: xfail more Emscripten stack overflows
gh-127146: xfail more Emscripten stack overflows (#134358)
pythongh-127146: xfail more Emscripten stack overflows (pythonGH-134358)
[3.14] gh-127146: xfail more Emscripten stack overflows (GH-134358) (#…
pythongh-127146: xfail more Emscripten stack overflows (python#134358)
pythongh-127146: Allow ignored keys to be missing in test_sysconfig
pythongh-127146: Emscripten: Fix pathlib glob_dotdot test
pythongh-127146: Emscripten: Fix test failure due to missing os.link
pythongh-127146: Emscripten: Skip test_url2pathname_resolve_host
pythongh-127146: Enable large files on Emscripten
gh-127146: Allow ignored keys to be missing in test_sysconfig (#135622)
pythongh-127146: Allow ignored keys to be missing in test_sysconfig (p…
gh-127146: Emscripten: Skip test_url2pathname_resolve_host (#135634)
pythongh-127146: Emscripten: Skip test_url2pathname_resolve_host (pyt…
[3.14] gh-127146: Allow ignored keys to be missing in test_sysconfig (G…
gh-127146: Emscripten: Fix test failure due to missing os.link (#135626)
pythongh-127146: Emscripten: Fix test failure due to missing os.link (p…
gh-127146: Emscripten: Fix pathlib glob_dotdot test (#135624)
pythongh-127146: Emscripten: Fix pathlib glob_dotdot test (pythonGH-1…
[3.14] gh-127146: Emscripten: Skip test_url2pathname_resolve_host (GH…
freakboy3742 commentedon Jun 18, 2025
A status update: As of the state of #135635 (based off cb39410), I'm seeing the following problems when running with Emscripten 4.0.10, on macOS.
I get an error building
libffiif the Emscripten build script is run using Python 3.14. This is caused by #135648; a workaround is described on that ticket.I'm getting a hard interpreter crash (stack overflow) unless I add
skip_emscripten_stack_overflowto:I then get 6 failures on a full
python.sh -m test -v -uall --rerun --single-process -Wtest run:test_os; this is 100% reliable for me on macOS.Test failures
test_pathlib; this is an intermittent failure (maybe 50% of the time); it looks like there might be a granularity issue with the time check being performed.Test failures
test_shutil; this looks like it might be a macOS filesystem detail leaking through?Test failures
test_tarfile; this looks like it's a limit that might be different; it might be macOS related?Test failures
test_unicode_file_functions; this looks like it might be a macOS filesystem detail leaking through?Test failures
As soon as #135635 merges, I'll run the same tests on the buildbot to see what is repeatable there.
[3.14] gh-127146: Emscripten: Fix test failure due to missing os.link (…
[3.14] gh-127146: Emscripten: Fix pathlib glob_dotdot test (GH-135624) (
pythongh-127146: Enable large files on Emscripten (pythonGH-135635)
gh-127146: Enable large files on Emscripten (#135635)
[3.14] gh-127146: Enable large files on Emscripten (GH-135635) (#135655)
pythongh-127146: Add skip_emscripten_stack_overflow in a few places
gh-127146: Add skip_emscripten_stack_overflow in a few places (#135722)
pythongh-127146: Add skip_emscripten_stack_overflow in a few places (p…
pythongh-127146: Allow ignored keys to be missing in test_sysconfig (p…
pythongh-127146: Emscripten: Skip test_url2pathname_resolve_host (pyt…
pythongh-127146: Emscripten: Fix test failure due to missing os.link (p…
pythongh-127146: Emscripten: Fix pathlib glob_dotdot test (python#135624
pythongh-127146: Enable large files on Emscripten (python#135635)
[3.14] gh-127146: Add skip_emscripten_stack_overflow in a few places (G…
freakboy3742 commentedon Jun 19, 2025
On the buildbot machine, the situation is a lot better - there's only one failure, in
test_os:Again, this is a 100% reliable failure.
pythongh-127146: Skip test_os.test_mode for Emscripten
gh-127146: Skip test_os.test_mode for Emscripten (#135764)
pythongh-127146: Skip test_os.test_mode for Emscripten (pythonGH-135764)
[3.14] gh-127146: Skip test_os.test_mode for Emscripten (GH-135764) (#…
pythongh-127146: Skip test_netrc.test_security on Emscripten
freakboy3742 commentedon Jul 9, 2025
Current status - 3 failing tests:
test_pydoc:
test_netrc - (see #136227 for some discussion)
test_sqlite3
hoodmane commentedon Jul 10, 2025
So it looks like the netrc problem is that we don't copy the uid over from the native FS to the Emscripten FS. Maybe we can fix it.
hoodmane commentedon Jul 10, 2025
getuid()in Emscripten is defined here:https://github.com/emscripten-core/emscripten/blob/main/system/lib/libc/emscripten_syscall_stubs.c#L153
to always return 0, but with weak linkage so we could override it if we want.
pythongh-127146: Report uid in Emscripten + node as native uid
pythongh-127146: Report uid in Emscripten + node as native uid
pythongh-127146: Skip test_open_undecodable_uri on Emscripten
pythongh-127146: Skip test_open_undecodable_uri on Emscripten
hoodmane commentedon Jul 10, 2025
I can't reproduce the
test_apropos_empty_docfailure. Opened #136510 to put back the test skip fortest_open_undecodable_uriand opened #136509 to fix the netrc bug.freakboy3742 commentedon Jul 11, 2025
I can't reproduce the
test_apropos_empty_doctest on my machine either - but interestingly, looking at the code, it's another test that useschmod... I wonder if it might be part of the same cluster of issues.hoodmane commentedon Jul 11, 2025
Opened upstream issue about
test_open_undecodable_uri: the problem is that theUTF8ArrayToString()function used to decode the path argument toopenat()has separate code paths for <= 16 bytes and > 16 bytes strings and they don't do the same thing:emscripten-core/emscripten#24690
pythongh-127146: xfail more Emscripten stack overflows (python#134358)
pythongh-127146: Allow ignored keys to be missing in test_sysconfig (p…
pythongh-127146: Emscripten: Skip test_url2pathname_resolve_host (pyt…
pythongh-127146: Emscripten: Fix test failure due to missing os.link (p…
pythongh-127146: Emscripten: Fix pathlib glob_dotdot test (python#135624
pythongh-127146: Enable large files on Emscripten (python#135635)
pythongh-127146: Add skip_emscripten_stack_overflow in a few places (p…
pythongh-127146: Skip test_os.test_mode for Emscripten (python#135764)
pythongh-127146: Fix test_open_undecodable_uri by setting `-sTEXTDECO…
gh-127146: Emscripten: Fix test_open_undecodable_uri by setting `-sTE…
pythongh-127146: Emscripten: Fix test_open_undecodable_uri by setting…
[3.14] gh-127146: Emscripten: Fix test_open_undecodable_uri by settin…
gh-127146: Report uid in Emscripten + node as native uid (#136509)
pythongh-127146: Report uid in Emscripten + node as native uid (pytho…
[3.14] gh-127146: Report uid in Emscripten + node as native uid (GH-1…
pythongh-127146: Emscripten: Make os.umask() actually work
pythongh-127146: Emscripten: Don't need to avoid unpaired surrogate a…
pythongh-127146: Emscripten: use skip_emscripten_stack_overflow inste…
gh-127146: Emscripten: Make os.umask() actually work (#136706)
pythongh-127146: Emscripten: Make os.umask() actually work (pythonGH-…
gh-127146: Emscripten: more regular stack overflow skips (#136708)
pythongh-127146: Emscripten: more regular stack overflow skips (pytho…
gh-127146: Emscripten: Don't need to avoid unpaired surrogate anymore (…
pythongh-127146: Emscripten: Don't need to avoid unpaired surrogate a…
[3.14] gh-127146: Emscripten: more regular stack overflow skips (GH-1…
[3.14] gh-127146: Emscripten: Make os.umask() actually work (GH-136706)…
[3.14] gh-127146: Emscripten: Don't need to avoid unpaired surrogate …
freakboy3742 commentedon Jul 17, 2025
After a lot of hair pulling, I've tracked down the source of the
test_pydoc.test_apropos_empty_docfailure - it's umasking again.When running locally, or in a code checkout on the CI machine, the test directory has 755 permissions, which L1313 of the test masks down to 655.
However, under CI, the test folder has 700 permissions. This means the created directory isn't visible, and so it doesn't appear in the return data.
The only reasons I can think that the test would generate 700 permissions are:
Or possibly a combination of 1 and 2. Given that we already know that 2 is at least partially true already, I think I'm comfortable making this a test skip (with an open ticket for CPython to resolve umask issues once Emscripten has corrected those APIs).
pythongh-127146: Emscripten: Set umask to zero in python.sh
gh-127146: Emscripten: Set umask to zero in python.sh (#136740)
pythongh-127146: Emscripten: Set umask to zero in python.sh (pythonGH…
[3.14] gh-127146: Emscripten: Set umask to zero in python.sh (GH-136740…
freakboy3742 commentedon Jul 17, 2025
Closing .... because all the tests are now passing!!
pythongh-127146: xfail more Emscripten stack overflows (python#134358)
pythongh-127146: Allow ignored keys to be missing in test_sysconfig (p…
pythongh-127146: Emscripten: Skip test_url2pathname_resolve_host (pyt…
pythongh-127146: Emscripten: Fix test failure due to missing os.link (p…
pythongh-127146: Emscripten: Fix pathlib glob_dotdot test (python#135624
pythongh-127146: Enable large files on Emscripten (python#135635)
pythongh-127146: Add skip_emscripten_stack_overflow in a few places (p…
pythongh-127146: Skip test_os.test_mode for Emscripten (python#135764)
pythongh-127146: Emscripten: Fix test_open_undecodable_uri by setting…
pythongh-127146: Report uid in Emscripten + node as native uid (pytho…
pythongh-127146: Emscripten: Make os.umask() actually work (python#13…
pythongh-127146: Emscripten: more regular stack overflow skips (pytho…
pythongh-127146: Emscripten: Don't need to avoid unpaired surrogate a…
pythongh-127146: Emscripten: Set umask to zero in python.sh (python#1…
pythongh-127146: Emscripten: Add test_sample_profiler skips where needed
gh-127146: Emscripten: Add test_sample_profiler skips where needed (#…
pythongh-127146: Allow ignored keys to be missing in test_sysconfig (p…
pythongh-127146: Emscripten: Skip test_url2pathname_resolve_host (pyt…
pythongh-127146: Emscripten: Fix test failure due to missing os.link (p…
pythongh-127146: Emscripten: Fix pathlib glob_dotdot test (python#135624
pythongh-127146: Enable large files on Emscripten (python#135635)
pythongh-127146: Add skip_emscripten_stack_overflow in a few places (p…
pythongh-127146: Skip test_os.test_mode for Emscripten (python#135764)
pythongh-127146: Emscripten: Fix test_open_undecodable_uri by setting…
pythongh-127146: Report uid in Emscripten + node as native uid (pytho…
pythongh-127146: Emscripten: Make os.umask() actually work (python#13…
pythongh-127146: Emscripten: more regular stack overflow skips (pytho…
pythongh-127146: Emscripten: Don't need to avoid unpaired surrogate a…
pythongh-127146: Emscripten: Set umask to zero in python.sh (python#1…
pythongh-127146: Emscripten: Add test_sample_profiler skips where nee…