Test262: accept ENOTEMPTY and EEXIST in fs/rename.t.mjs - #1104
Merged
Conversation
Renaming a regular file onto an existing directory is permitted by POSIX to fail with EISDIR, ENOTDIR, ENOTEMPTY or EEXIST, and the exact errno depends on the kernel and filesystem. The test only accepted ENOTDIR and EISDIR, so it began failing on the ubuntu-26.04 CI runners whose newer kernel returns ENOTEMPTY (or EEXIST) for this case. Accept ENOTEMPTY and EEXIST in all three variants (sync, callback and promise based) to make the test robust across kernels while still rejecting genuinely unexpected errors.
VadimZhestikov
force-pushed
the
fix-rename-test-errno-ubuntu2604
branch
from
July 29, 2026 22:05
55e4bd4 to
a0248b3
Compare
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.
Problem
The
test/fs/rename.t.mjsTest262 test started failing on theubuntu-26.04 CI runners (both amd64 and arm64), e.g.
run #228:
All 6047 njs unit tests pass and the build succeeds; only this single
Test262 case fails, and only on ubuntu-26.04 (the newest distro in the
matrix). The commit that triggered the run only touched
SECURITY.md, sothe failure is environmental rather than a code regression.
Root cause
The test renames a regular file onto its (non-empty) parent directory and
expects the syscall to fail with
ENOTDIRorEISDIR:Renaming a file onto an existing directory is permitted by POSIX to fail
with
EISDIR,ENOTDIR,ENOTEMPTYorEEXIST, and the exact errnodepends on the kernel and filesystem. Older kernels return
ENOTDIRhere,but the newer kernel on the ubuntu-26.04 runners returns
ENOTEMPTY(orEEXIST), which the test did not accept, so the promise rejects.The test file has not changed since 2024-12 (
dfec49b1), confirming thisis a kernel behavior difference rather than an njs bug.
Fix
Accept
ENOTEMPTYandEEXISTin addition toENOTDIR/EISDIRin allthree variants of the test (sync, callback and promise based). Genuinely
unexpected errors are still rejected.
Verification
TOTAL: PASSED [156/156].ENOTEMPTY/EEXISTare now accepted while an unrelated code such as
ENOENTis stillrejected.
which exercises the real ubuntu-26.04 runners.
Root cause confirmed: kernel behavior change (not build flags).
Pinned the exact upstream kernel commit behind the behavior change.