Skip to content

Commit 0d13ef8

Browse files
committed
Improve error handling and assertions in compose up test
1 parent 4bebd95 commit 0d13ef8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pkg/e2e/up_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,13 @@ func TestUpDependenciesNotStopped(t *testing.T) {
9494
err = cmd.Wait()
9595
if err != nil {
9696
var exitErr *exec.ExitError
97-
errors.As(err, &exitErr)
98-
// Process is expected to die from re-raised SIGINT signal
97+
if !errors.As(err, &exitErr) {
98+
t.Fatalf("`compose up` failed with non-exit error: %v", err)
99+
}
100+
// Process is expected to die from re-raised SIGINT signal (exit code -1).
101+
// If signal re-raise doesn't terminate the process, the fallback path exits with code 130.
99102
assert.Assert(t, exitErr.ExitCode() == -1 || exitErr.ExitCode() == 130,
100-
"`compose up` exited with unexpected code: %v", err)
103+
"`compose up` exited with unexpected code: %d (%v)", exitErr.ExitCode(), err)
101104
}
102105

103106
RequireServiceState(t, c, "app", "exited")

0 commit comments

Comments
 (0)