Fix testExecOnExitingContainer (#1107)

Check the container remains only, not its status as the status might not
have been updated at the time checking.
This commit is contained in:
jwhur
2026-01-28 17:17:08 -08:00
committed by GitHub
parent d8722708ec
commit 371db6d244
@@ -122,9 +122,15 @@ class TestCLIExecCommand: CLITest {
do {
_ = try doExec(name: name, cmd: ["sleep", "infinity"])
} catch CLIError.executionFailed(let message) {
#expect(message.contains("is not running"))
// There's no nice way to check fail reason here
#expect(message.contains("is not running"), "expected container is not running if exec failed")
}
// Give time for the exec (or start) error handling settles down
sleep(1)
#expect(throws: Never.self, "expected the container remains") {
try getContainerStatus(name)
}
#expect(try getContainerStatus(name) == "stopped")
}
}
}