Commit 68aa31a
Pin the quarantine test on the rename failure
testQuarantineRenameFailurePreservesOriginalSlot counted the slot's .sfa
files BEFORE build(), then asserted the count was unchanged after the
failed rename. Recovery legitimately unlinks an empty never-rotated
hot-spare on the way in (SegmentRing drops a recovered segment whose
frameCount() is 0 with no torn tail), and whether SegmentManager had
provisioned one by then is a race -- so the assertion measured that race
rather than the rename. It failed 3 of 3 standalone runs, and inverted
(2 vs 3) under load.
Snapshot inside the quarantineAfterCloseHook instead: after the engine
closed, before the rename. That is exactly what "a failed rename
preserves the slot" means, and it is immune to the hot-spare race because
both counts observe the post-recovery state. Assert the snapshot is
non-zero as well, so the equality cannot pass vacuously on an empty slot.
The product was never at fault: the reclaimed segment holds no frames, and
close() unlinks nothing -- instrumenting quarantineTornSlot shows the same
segments before and after it. Mutating that method to delete a segment
during the failed rename still fails the test (expected 2, was 1), so it
continues to catch real destruction.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 9cc550f commit 68aa31a
1 file changed
Lines changed: 16 additions & 2 deletions
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
474 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
475 | 484 | | |
476 | 485 | | |
477 | 486 | | |
| |||
503 | 512 | | |
504 | 513 | | |
505 | 514 | | |
| 515 | + | |
506 | 516 | | |
507 | 517 | | |
508 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
509 | 523 | | |
510 | | - | |
| 524 | + | |
511 | 525 | | |
512 | 526 | | |
513 | 527 | | |
| |||
0 commit comments