authority: register the lost-range fault hook cleanup before the assertion

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pingqiuandClaude Opus 5.5 committed 2026-11-20 19:22:41 -08:00
1 parent 093fbc26f8
commit ab0a8c783e
1 file changed
+1
@@ -26,6 +26,7 @@ func TestWorkspaceUncertainIssueWriteIsTyped(t *testing.T) {
}
*now = barrier.Add(time.Second)
testLostRangeFaultHook = func(string) error { return errInjected }
t.Cleanup(func() { testLostRangeFaultHook = nil })
if _, err := p.MoveWorkspace(ctx, req, forcedLostRangeHead); !errors.Is(err, errInjected) || errors.Is(err, ErrWorkspaceOutcomeUncertain) {
t.Fatalf("lost-range write failure before the issue: %v; want a plain refusal", err)
}