Repository navigation
Commit d6fa711
committed
test(file-safety,utils,core): pin the order and flush the rows raised on 2357's head
Four of the seven rows CodeRabbit left open on 4d60c40 are test-side, so they land here
rather than being explained away. Each one was run against a production control first, so the
assertion is known to bite for the reason the row named and not for some unrelated drift.
- utils/__tests__/fileLock.spec.ts, row 4509350112 (retarget ordering). The double logged
nothing, so the row proved only which keys were asked for and that the callback ran once.
Acquisitions and the one release now log around the same 30 ms hold the release uses and the
callback logs into the same list, which is the ported semantics of the same row on 2359:
acquire:1:started, acquire:1:completed, release:started, release:completed, acquire:2:started,
acquire:2:completed, callback. Control at src/utils/fileLock.ts:198 (acquisition promise not
awaited before the callback) turns this row red - 1 failed | 10 passed (11) - with callback
landing before acquire:2:completed and nothing else in the list moving; the byte-identical
restore returns it to green.
- utils/__tests__/fileLock.spec.ts, row 4509350106 (reject path through the other entry point).
The reviewer is right that withFileLock calls canonicalLockPath and _lockCanonicalKey directly
and never passes through acquireFileLock, so the two existing rejection rows cannot see a
fallback added only to the exported entry point. Two rows now drive EACCES and a code-less
realpath failure through acquireFileLock itself and assert no lock was taken. Control:
canonicalLockPath(filePath).catch(() => path.resolve(filePath)) at src/utils/fileLock.ts:164 -
2 failed | 9 passed (11), failing exactly those two rows while the withFileLock rows stay
green, which is the blind spot the row described.
- services/file-safety/__tests__/safeWriteText.spec.ts, row 4509350103 (ancestor flush). The row
asserted which directories were opened with "r"; opening and closing without flushing would
have passed. The double now hands out distinct descriptors (901 deep, 902 nested, 903 root) and
the row asserts each descriptor is fsynced and closed in the same deepest-first order. Control
at src/services/file-safety/safeWriteText.ts:328 (handle opened and closed, never flushed):
this row red with "expected [] to deeply equal [901, 902, 903]"; two existing fsync rows go
red with it, which is expected - they assert the same fsync from the other side.
- core/task/__tests__/Task.spec.ts, row 4509350094 (fence before the abort settles). abortTask
now started rather than awaited and the first increment asserted while its promise is pending,
then awaited for the existing 0 -> 2 assertion. Control: defer requestAbort one microtask
inside Task.abortTask - this row red with "expected +0 to be 1" (a concurrent-abort row also
trips, because making the method async changes the memoized promise identity, which is an
artifact of the control shape and not of this assertion).
Measured here at this commit with @roo-code/* mapped onto the tree under test: fileLock.spec 11
passed (11), safeWriteText.spec 83 passed (83), Task.spec 213 passed (213), whole misc lane 121
files / 2138 passed | 17 skipped (2155), tsc --noEmit -p . exit 0, eslint
--max-warnings=0 --no-warn-ignored exit 0 and prettier --check clean on the committed bytes (the
payload .husky/pre-commit would have charged, which does not run here because core.hooksPath
points at .husky/_). Core and services were re-run at file scope for the two files they own.
The gate's own functions report 770 counted executable lines with these three files changed in
the tree and 770 at 4d60c40 before them: a test-only commit cannot move that number, because
packageForPath returns undefined for __tests__ paths. The three production files were each
restored byte-identical after their control run.1 parent 4d60c40 commit d6fa711
3 files changed
Lines changed: 97 additions & 4 deletions
File tree
- src
- core/task/__tests__
- services/file-safety/__tests__
- utils/__tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4834 | 4834 | | |
4835 | 4835 | | |
4836 | 4836 | | |
4837 | | - | |
| 4837 | + | |
| 4838 | + | |
| 4839 | + | |
| 4840 | + | |
| 4841 | + | |
| 4842 | + | |
| 4843 | + | |
| 4844 | + | |
| 4845 | + | |
4838 | 4846 | | |
4839 | 4847 | | |
4840 | 4848 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1656 | 1656 | | |
1657 | 1657 | | |
1658 | 1658 | | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
1659 | 1665 | | |
1660 | 1666 | | |
1661 | 1667 | | |
| |||
1668 | 1674 | | |
1669 | 1675 | | |
1670 | 1676 | | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
1671 | 1700 | | |
1672 | 1701 | | |
1673 | 1702 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
110 | 136 | | |
111 | 137 | | |
112 | 138 | | |
| |||
233 | 259 | | |
234 | 260 | | |
235 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
236 | 268 | | |
237 | | - | |
238 | | - | |
239 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
240 | 282 | | |
241 | 283 | | |
242 | 284 | | |
243 | 285 | | |
244 | 286 | | |
| 287 | + | |
245 | 288 | | |
246 | 289 | | |
247 | 290 | | |
248 | 291 | | |
249 | 292 | | |
250 | 293 | | |
251 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
252 | 308 | | |
0 commit comments