diff --git a/Tests/CLITests/Subcommands/Containers/TestCLIExec.swift b/Tests/CLITests/Subcommands/Containers/TestCLIExec.swift index 16353253..eab8529e 100644 --- a/Tests/CLITests/Subcommands/Containers/TestCLIExec.swift +++ b/Tests/CLITests/Subcommands/Containers/TestCLIExec.swift @@ -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") } } }