fix: stop store-bound workers and reconcile settled repair fixtures

This commit is contained in:
2026-10-20 16:19:21 +01:00
parent fdf0369ede
commit 4e35da7473
5 changed files with 61 additions and 2 deletions
+12 -1
View File
@@ -100,11 +100,22 @@ func TestRuntimeRepairRejectsUnrecordedAndActiveVisits(t *testing.T) {
h, _, id := sessionExportRunner(t, "v2", func(stage.SessionExportRequest) (stage.SessionExportResult, error) {
return stage.SessionExportResult{}, errors.New("unavailable")
})
for _, sequence := range []int{0, 1, 2} {
for _, sequence := range []int{0, 2} {
if _, err := h.runner.repairSessionExport(context.Background(), id, sequence); err == nil {
t.Fatalf("invalid visit %d accepted", sequence)
}
}
// The shared fixture now confirms executor cleanup, as the runtime should.
// Explicitly model an in-flight executor for the active-visit repair case.
h.runner.mu.Lock()
h.runner.active[id] = activeRun{cancel: func() {}}
h.runner.mu.Unlock()
if _, err := h.runner.repairSessionExport(context.Background(), id, 1); err == nil {
t.Fatal("active visit accepted for export repair")
}
h.runner.mu.Lock()
delete(h.runner.active, id)
h.runner.mu.Unlock()
}
func TestCLIRepairSessionExportUsesRuntimeProtocol(t *testing.T) {