mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-11-26 21:53:46 +01:00
test(pi): make cleanup failure regression portable
This commit is contained in:
1 parent
cfe3f82dd4
commit
0186cc64b4
1 file changed
+4
-4
@@ -110,10 +110,10 @@ func TestDeleteTurnRollsBackWhenPiCleanupFails(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
blocked := filepath.Join(root, "not-a-directory")
|
||||
if err := os.WriteFile(blocked, []byte("blocked"), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// A regular file as the parent is treated as an absent target by Windows
|
||||
// RemoveAll. NUL is invalid on every supported OS and reliably exercises
|
||||
// the cleanup error/transaction rollback path without filesystem privileges.
|
||||
blocked := filepath.Join(root, "invalid\x00root")
|
||||
if err := db.SetAgentSessionDir(blocked); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user