Verify preflight recovery and cleanup interactions

This commit is contained in:
2026-11-30 15:29:28 +00:00
parent 6ea1b42d2a
commit 727ed783d1
4 changed files with 181 additions and 1 deletions

View File

@@ -130,6 +130,18 @@ func TestSessionValidationHoldsLockUntilProbeFilesAreFinished(t *testing.T) {
if _, err := os.Lstat(paths.RunsDir); !errors.Is(err, os.ErrNotExist) {
t.Fatalf("completed probes survived cleanup: %v", err)
}
if _, err := os.Stat(paths.InputsDir); err != nil {
t.Fatalf("cleanup removed prepared inputs: %v", err)
}
retryDeps := fakeCommandDependencies(&storage.FakeBackend{}, nil)
retryDeps.newNotarius = func() notarius.Runner { return &notarius.FakeRunner{} }
retry, err := inspectConfiguredForTest(ctx, cfg, retryDeps)
if err != nil || retry.Preparation.Outcome != "reused" {
t.Fatalf("preflight after cleanup: %+v, %v", retry, err)
}
if _, err := os.Stat(artifacts.SessionInvocationProbeDir(paths, retry.RunID, "audita")); err != nil {
t.Fatalf("preflight did not recreate probe space: %v", err)
}
})
}
}