Repository navigation
Commit f739a5f
committed
Compare the interruption injection against identity so main's rows fire on an aliased temp
The file this repairs is main's: src/utils/__tests__/safeWriteJson.interruption.test.ts, blob
c9c5993 at 73931fe, and it was absent from this branch before the
merge (git cat-file -e e62f198:src/utils/__tests__/safeWriteJson.interruption.test.ts exits 128).
This is a prerequisite for a test main carries, not unit content: no production file is touched here.
Main's kill point is whole-path equality - child line 40, `if (path.resolve(String(newPath)) ===
targetPath)`, with targetPath = path.resolve(process.env.INTERRUPTION_TARGET_PATH). This PR publishes
through a realpath-resolved string, node's async fs.realpath expands an NTFS 8.3 alias, and
path.resolve preserves the spelling it is handed. On a runner whose temp path is reported as an alias
- the normal windows-latest condition, where the profile is RUNNER~1 - the writer's rename
destination and the parent's authorized spelling are two strings naming one file, the injection never
matches, the child prints WRITE_COMPLETED, and every row in the file fails. That is exactly what
platform-unit-test (windows-latest) reported at 8fa7d85: 12 failures, all of them
`expected 'WRITE_COMPLETED\n' to contain 'EXIT_AT_REPLACEMENT_RENAME'` at that file's line 187, with
the leg failing on its own merit (03:53:47 -> 04:00:01) rather than as a cancellation.
Measured on this box (pinned node v22.23.4; box node 25.9.0), in both directions: TEMP/TMP at
C:\work\Zoo-Code-fork\.tmp-alias-vps2f\long-directory-name-under-alias -> 12 passed; TEMP/TMP at its
8.3 form C:\work\ZOO-CO~1\TMP-AL~2\LONG-D~1 with main's copy -> 12 failed carrying CI's assertion
verbatim; the same aliased TEMP with the predicate below -> 12 passed; long spelling with the
predicate -> 12 passed, so nothing here is pinned to the alias.
This lands the basename plus the containing directory's dev+ino predicate, cited from 1fb5fcc,
which is where the fix exists today (Zoo-Code-Org#1912). Measured against that copy, this file differs by 13
insertions and 13 deletions, and every one of those lines is either the local variable name (this
file keeps main's `targetPath`, that copy renamed it `targetSpec`) or the re-wrapping of the
explanatory comment - so Zoo-Code-Org#1912's fix touched nothing else in the file, and the predicate here is the
same mechanism written into the copy main carries. That is not a convergence onto Zoo-Code-Org#1912's text: it is
a second lane grafting the same thing, and the two copies will conflict. Whichever merge lands first
supplies the canonical text - merge order, not merit - and the conflict is expected rather than
surprising.
One disclosure about the previous commit that its own message did not carry: 7bf2654 added
`chmod: vi.fn(actual.chmod)` to the fs/promises mock factory in safeWriteJson.test.ts. That spec's
beforeEach pre-creates the target (line 90), so every row in that file that reaches the publish now
calls chmod through the delegating spy where it previously reached the real function through
`...actual`; behaviour is unchanged because the spy calls through, and no row before that commit
asserted on chmod (`git grep -nE "vi\\.mocked\\(fs\\.chmod\\)" 8fa7d85` returns nothing).
Gates on this commit's tree, pinned 22.23.4: interruption spec 12 passed under both temp spellings;
prettier --check clean; eslint --max-warnings=0 exit 0 on the touched file, run without
--prune-suppressions so src/eslint-suppressions.json is untouched; tsc -p src/tsconfig.json exit 0.
The misc shard was measured on the identical tree at 7bf2654 (2118 passed / 17 skipped) and this
commit touches only this spec file.
Refs: Zoo-Code-Org#1375, Zoo-Code-Org#1991, Zoo-Code-Org#2019.1 parent 7bf2654 commit f739a5f
1 file changed
Lines changed: 34 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
35 | 67 | | |
36 | | - | |
| 68 | + | |
37 | 69 | | |
38 | 70 | | |
39 | 71 | | |
40 | | - | |
| 72 | + | |
41 | 73 | | |
42 | 74 | | |
43 | 75 | | |
| |||
0 commit comments