mirror of
https://github.com/apple/container.git
synced 2026-09-22 23:55:34 +00:00
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:
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user