Skip to content

Commit

Permalink
Tests to error on timeout
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <[email protected]>
  • Loading branch information
apostasie committed Feb 13, 2025
1 parent 8a80f86 commit dd9856a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/testutil/test/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ func (gc *GenericCommand) Run(expect *Expected) {
// -1 means any error
assert.Assert(gc.t, result.ExitCode != 0,
"Expected exit code to be different than 0\n"+debug)
} else if result.Timeout {
assert.Assert(gc.t, false,
fmt.Sprintf("Command timed-out\n")+debug)

Check failure on line 158 in pkg/testutil/test/command.go

View workflow job for this annotation

GitHub Actions / go | freebsd |

S1039: unnecessary use of fmt.Sprintf (gosimple)

Check failure on line 158 in pkg/testutil/test/command.go

View workflow job for this annotation

GitHub Actions / go | windows |

S1039: unnecessary use of fmt.Sprintf (gosimple)
} else {
assert.Assert(gc.t, expect.ExitCode == result.ExitCode,
fmt.Sprintf("Expected exit code: %d\n", expect.ExitCode)+debug)
Expand Down

0 comments on commit dd9856a

Please sign in to comment.