You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: pin the fence read-error path-strip with a positive unit test #4191
The strip is a string-suffix match against Node's current fs error message format. The parity fixture (tests/fixtures/control_plane/legacy_writer_fence_caller_parity_v0.json:136) pins the path-free expectation, but nothing constructs a real fs error carrying error.path and asserts the strip actually fired. If Node ever changes its message shape (unquoted path, double quotes, path mid-message), the strip silently stops working and absolute local paths leak back into public reason — with no test going red.
Suggested fix
One focused unit test: construct an ENOENT-shaped error whose .path is a temp absolute path and whose .message ends with '<path>'; call the reader; assert reason contains no path fragment. A negative arm (error without path) asserting the message is preserved unchanged would also cover the defensive branch.
I am taking this focused test-only follow-up. I will exercise the production fence reader with a path-bearing non-ENOENT read error and a no-path error, plus real filesystem readback. ENOENT needs separate missing-state coverage because it returns before the cleanup branch. I will verify that removing production path cleanup makes the new test fail, keep runtime behavior unchanged, and avoid the parity-normalizer files being changed in #4168.
Activity
Job28703 commentedon Sep 10, 2026
Linked PR: #4127 (reviewed head
2fb24a89; the path-strip change is in commit2fb24a89/legacy_writer_fence.ts:145-152).LIHUA919 commentedon Sep 12, 2026
I am taking this focused test-only follow-up. I will exercise the production fence reader with a path-bearing non-ENOENT read error and a no-path error, plus real filesystem readback. ENOENT needs separate missing-state coverage because it returns before the cleanup branch. I will verify that removing production path cleanup makes the new test fail, keep runtime behavior unchanged, and avoid the parity-normalizer files being changed in #4168.