Repository navigation
test: skip tests the temporary folders' base cannot run - #2083
Merged
Merged
Conversation
Package builds such as omarchy-pkgs run the suite in a container whose /tmp is overlayfs, which has O_TMPFILE only since Linux 6.10 and gives file handles only when exported over NFS. The tests that stage unnamed files or follow file handles now probe the base once and skip with a message where it lacks them; STRATA_REQUIRE_DEVICE_TESTS, which CI and scripts/test-headless.py set on their tmpfs, fails them instead. The ui_thread tests check a debug_assert!, so they are compiled only with debug assertions rather than failing every `cargo test --release`.
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.
Description
Package builds such as omarchy-pkgs run
cargo test --releasein a container whose/tmpis overlayfs, which hasO_TMPFILEonly since Linux 6.10 and gives file handles only when exported over NFS. Sixteen file-operation tests assumed both and failed there on every Strata release since 1.1.0, and theui_threadtest checks adebug_assert!, so it failed under any release-mode run.test_support::temp_basemodule probes once per process whether the base under the temporary folders links unnamed files into place, andlocal_operations::testsadds the matching probe for file handles. The 16 tests, or the rows of their tables that need those primitives, skip with a message on a base without them.STRATA_REQUIRE_DEVICE_TESTS=1, which CI andscripts/test-headless.pyalready set on their tmpfs, fails them instead, so CI cannot skip silently.handleless_basemount-type lookup in the case-rename test, which covered exfat and SMB but not overlayfs.ui_threadtests are compiled only with debug assertions.docs/testing.mdanddocs/trash-restore-testing.mddescribe the requirement and the variable.Verified by running both filesystem test modules under a seccomp filter that refuses
O_TMPFILEwith EOPNOTSUPP (reproduces exactly the 13 Omarchy tmpfile failures on main; all skip or pass with this change) and withTMPDIRon an unprivileged overlayfs mount (reproduces the 3 file-handle failures on main; all skip with this change). WithSTRATA_REQUIRE_DEVICE_TESTS=1the same 13 tests fail with the probe's message. The 17 affected tests still pass on a tmpfs/tmp.Visual evidence
N/A: test-only change with no user-visible behaviour.
How to test
TMPDIRpointing at a filesystem withoutO_TMPFILE, runcargo test --all-targets --all-features -- --nocapture adapters::local_operations::tests::file_copy::and confirm the tmpfile tests printSkipping: the base of the temporary folders offers no unnamed files linked into placeand the run passes.TMPDIRon an overlayfs mount, runcargo test --all-targets --all-features -- --nocapture a_file_handle_follows_the_item_and_not_its_nameand confirm it skips for file handles.STRATA_REQUIRE_DEVICE_TESTS=1and confirm the same tests fail withthe base of the temporary folders offers no …; point TMPDIR at a tmpfs.cargo test --release --all-targets --all-features -- ui_threadand confirm noui_threadtest runs or fails.Expected result: On a tmpfs
/tmpevery affected test runs and passes; on an overlay or tmpfile-less base they skip with a message, and onlySTRATA_REQUIRE_DEVICE_TESTS=1turns those skips into failures.Related issue
Closes #2082