Verify preflight recovery and cleanup interactions
This commit is contained in:
@@ -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 ¬arius.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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user