tests: enable test_importlib subpackage (#491)#551
Merged
Conversation
39b009d to
9a3cb94
Compare
There was a problem hiding this comment.
Pull request overview
Enables CPython’s test_importlib subpackage in the Nanvix test suite by adding it to the Nanvix test list and applying Nanvix-specific skips for known kernel/VFS limitations (standalone FAT VFS, hosted linuxd passthrough, and static-only builds). It also adjusts the Nanvix test harness to avoid hosted hangs by running the guest Python with -B in direct mode.
Changes:
- Add
test_importlibto the Nanvix test module allowlist and enable running its sub-areas with targetedNSKIP-based skips. - Introduce/extend Nanvix platform discrimination in test support and update multiple tests to skip known-failing/hanging cases.
- Update
.nanvix/run-tests.pydirect-mode invocation to pass-Bto prevent hosted kernel hangs during bytecode writes.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/nanvix-ci.yml | CI workflow adjustments related to updated Nanvix testing. |
| .nanvix/build.py | Build tooling tweaks supporting updated test enablement. |
| .nanvix/config.py | Adds test_importlib to NANVIX_TEST_LIST. |
| .nanvix/nanvix.toml | Pins/updates Nanvix tooling configuration. |
| .nanvix/package.py | Packaging/tooling updates for the new test surface. |
| .nanvix/run-regrtest.py | Removes/adjusts regrtest runner logic for new harness behavior. |
| .nanvix/run-tests.py | Passes -B in direct mode; documents hosted rename/replace hang. |
| .nanvix/test.py | Expands test orchestration/filters to include test_importlib. |
| .nanvix/z.py | Refactors/updates Nanvix zutil script behaviors for new flows. |
| Lib/test/support/init.py | Adds Nanvix topology helpers and hosted cleanup workarounds. |
| Lib/test/support/os_helper.py | Nanvix-specific filesystem/test cleanup accommodations. |
| Lib/test/support/socket_helper.py | Updates socket helper behavior for Nanvix constraints. |
| Lib/test/test_array.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_ast.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_builtin.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_code.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_collections.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_contextlib.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_coroutines.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_decimal.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_defaultdict.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_deque.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_dict.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_exception_group.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_exceptions.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_fractions.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_functools.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_importlib/extension/test_finder.py | Skips extension-module tests on static-only Nanvix. |
| Lib/test/test_importlib/extension/test_loader.py | Skips extension-module tests on static-only Nanvix. |
| Lib/test/test_importlib/import_/test_path.py | Adds Nanvix skips for known cleanup failures. |
| Lib/test/test_importlib/resources/test_path.py | Skips hosted Nanvix due to rmtree/rmdir cleanup issues. |
| Lib/test/test_importlib/resources/test_resource.py | Adds hosted Nanvix skips for cleanup-related failures. |
| Lib/test/test_importlib/source/test_case_sensitivity.py | Skips standalone Nanvix for FAT case/8.3 behavior. |
| Lib/test/test_importlib/source/test_file_loader.py | Skips Nanvix modes affected by rename/replace hangs. |
| Lib/test/test_importlib/source/test_finder.py | Skips Nanvix modes affected by rename/replace hangs. |
| Lib/test/test_importlib/source/test_source_encoding.py | Skips standalone Nanvix due to rename hang surface. |
| Lib/test/test_importlib/test_api.py | Adds Nanvix skips around reload/rename behaviors. |
| Lib/test/test_importlib/test_lazy.py | Skips threaded race test on Nanvix thread-limit constraints. |
| Lib/test/test_importlib/test_locks.py | Skips module on Nanvix due to thread-limit constraints. |
| Lib/test/test_importlib/test_main.py | Adds hosted Nanvix skips for cleanup failures; targeted skips. |
| Lib/test/test_importlib/test_metadata_api.py | Adds hosted/standalone Nanvix skips for known VFS errnos. |
| Lib/test/test_importlib/test_namespace_pkgs.py | Adds hosted Nanvix skip for cleanup failures. |
| Lib/test/test_importlib/test_pkg_import.py | Adds hosted/rename-hang related skips for Nanvix. |
| Lib/test/test_importlib/test_threaded_import.py | Skips module on Nanvix due to thread-limit constraints. |
| Lib/test/test_importlib/test_util.py | Adds Nanvix skips for rename/replace hang cases. |
| Lib/test/test_int.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_iter.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_itertools.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_list.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_math.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_operator.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_ordered_dict.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_queue.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_random.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_range.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_reprlib.py | Adds/updates Nanvix skip coverage for cleanup limitations. |
| Lib/test/test_set.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_slice.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_statistics.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_super.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_tuple.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_types.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| Lib/test/test_weakref.py | Adds Nanvix skips/adjustments for newly enabled coverage. |
| z.ps1 | Syncs bootstrap script with updated zutils template/version. |
| z.sh | Syncs bootstrap script with updated zutils template/version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ppenna
requested changes
Apr 28, 2026
Adds test_importlib to NANVIX_TEST_LIST and applies NSKIP guards for the failure classes that surface on Nanvix. Verified GREEN on both modes: standalone: 91/91 modules / 23/23 batches PASS single-process: 94/94 modules / 24/24 batches PASS NSKIPs applied (each at every site that triggers the underlying bug): - NSKIP008 (#476): tempfile names garbled test_main.test_unicode_dir_on_sys_path - NSKIP012 (#480): rmtree/rmdir cleanup failures test_main: 8 classes; test_metadata_api: APITests, LegacyDots, OffSysPathTests; test_pkg_import.TestImport; test_namespace_pkgs.test_invalidate_caches; resources/test_path (module); resources/test_resource: 2 methods; import_/test_path.test_deleted_cwd - NSKIP016 (#484): exceeds Nanvix thread limit test_locks (module), test_threaded_import (module), test_lazy.test_module_load_race - NSKIP021 (#501): FAT VFS rename() hangs the kernel [standalone] source/test_file_loader, source/test_finder, source/test_source_encoding (modules); test_api.test_reload_{location_changed,namespace_changed,submodule}; test_pkg_import.test_package_import__semantics; test_util.FindSpecTests: 4 methods - NSKIP026 (#506): FAT VFS returns wrong errno for path-edge cases test_metadata_api.APITests: 8 methods - NSKIP043 (#523): FAT VFS case-insensitivity / 8.3 short-name retention source/test_case_sensitivity (module) - NSKIP054 (NEW): static-only build, no dynamic extension modules extension/test_loader, extension/test_finder (modules) - NSKIP055 (NEW): linuxd rename()/replace() hangs the kernel on hosted Hosted analog of NSKIP021; paired at every NSKIP021 site since the user-visible symptom is identical but the bugs are independently fixable (different VFS layers). Also: .nanvix/run-tests.py direct (hosted) branch now passes -B, symmetric with the standalone branch which already does so. Without -B, importing any source whose mtime is newer than its compiled pyc hangs the guest kernel (NSKIP055). Mandatory infrastructure for hosted, not a test-specific workaround. Closes #491.
9a3cb94 to
4fb4fe7
Compare
ppenna
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Enables the full
test_importlibsub-package (45 test files across 9 sub-areas:source,frozen,extension,resources,import_,builtin,namespace_pkgs,partial,data) on Nanvix. Addstest_importlibtoNANVIX_TEST_LISTwith@unittest.skipIfannotations for the failure classes that surface on FAT VFS, linuxd, and the static-link build.Verified GREEN on both modes:
Also:
.nanvix/run-tests.pydirect (hosted) branch now passes-B, symmetric with the standalone branch which already does so. Without-B, importing any source whose mtime is newer than its compiled pyc hangs the guest kernel via NSKIP055 (linuxdos.replacehang); this is mandatory infrastructure for hosted, not a test-specific workaround.New NSKIPS
NSKIP055 is the hosted analog of NSKIP021: same user-visible symptom (
os.rename/os.replacehangs the kernel), but a distinct bug in a different VFS layer (linuxd RPC vs rust-fatfs). Independently fixable, so it gets its own ID. Every test that exercises rename now stacks both decorators (NSKIP021 fires on standalone, NSKIP055 on hosted).NSKIP054 covers the static-link build:
importlib.machinery.EXTENSION_SUFFIXESis non-empty but no.sofile exists onsys.path, soutil.EXTENSIONS.filenamestaysNoneand the upstreamRequires dynamic loading support.skip guard does not fire. Affects every test inextension/test_loader.pyandextension/test_finder.py.Refs: NSKIP008, NSKIP012, NSKIP016, NSKIP021, NSKIP026, NSKIP043, #371, #490
Closes #491.