Skip to content

Commit

Permalink
[CI:DOCS] Machine test timeout env var
Browse files Browse the repository at this point in the history
Introduce MACHINE_TEST_TIMEOUT, which sets the timeout for machine tests, in seconds.

Signed-off-by: Ashley Cui <[email protected]>
  • Loading branch information
ashley-cui committed Nov 15, 2023
1 parent fcf4f33 commit 3d88f61
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/machine/e2e/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -100,6 +101,13 @@ func newMB() (*machineTestBuilder, error) {
if os.Getenv("PODMAN_BINARY") != "" {
mb.podmanBinary = os.Getenv("PODMAN_BINARY")
}
if os.Getenv("MACHINE_TEST_TIMEOUT") != "" {
seconds, err := strconv.Atoi(os.Getenv("MACHINE_TEST_TIMEOUT"))
if err != nil {
return nil, err
}
mb.timeout = time.Duration(seconds) * time.Second
}
return &mb, nil
}

Expand Down

0 comments on commit 3d88f61

Please sign in to comment.