Skip to content

Commit

Permalink
add timeout helper
Browse files Browse the repository at this point in the history
  • Loading branch information
sideninja committed Jun 7, 2024
1 parent 3b9b5d4 commit 74d3cce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ func executeTest(t *testing.T, testFile string) {
parts := strings.Fields(command)

t.Run(testFile, func(t *testing.T) {
// timeout for tests
go func() {
time.Sleep(time.Minute * 2)
t.FailNow()
}()

cmd := exec.Command(parts[0], parts[1:]...)
if cmd.Err != nil {
panic(cmd.Err)
Expand Down

0 comments on commit 74d3cce

Please sign in to comment.