mirror of https://github.com/docker/docs.git
Merge pull request #270 from ehazlett/allow-diff-test-interval
allow for arbitrary test interval
This commit is contained in:
commit
d0c18b6c52
|
@ -9,9 +9,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
machineName = "machine-integration-test-%s"
|
||||
waitInterval = 30
|
||||
waitDuration = time.Duration(waitInterval * time.Second)
|
||||
machineName = "machine-integration-test-%s"
|
||||
)
|
||||
|
||||
func machineCreate(name string, t *testing.T, wg *sync.WaitGroup) {
|
||||
|
|
|
@ -4,7 +4,9 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type (
|
||||
|
@ -16,6 +18,8 @@ type (
|
|||
var (
|
||||
machineBinary = "machine"
|
||||
machineTestDrivers []MachineDriver
|
||||
waitInterval int
|
||||
waitDuration time.Duration
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -39,6 +43,19 @@ func init() {
|
|||
}
|
||||
}
|
||||
|
||||
interval := os.Getenv("MACHINE_TEST_DURATION")
|
||||
if interval == "" {
|
||||
interval = "30"
|
||||
}
|
||||
wait, err := strconv.Atoi(interval)
|
||||
if err != nil {
|
||||
fmt.Printf("invalid interval: %s\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
waitInterval = wait
|
||||
waitDuration = time.Duration(time.Duration(waitInterval) * time.Second)
|
||||
|
||||
// find machine binary
|
||||
if machineBin := os.Getenv("MACHINE_BINARY"); machineBin != "" {
|
||||
machineBinary = machineBin
|
||||
|
|
Loading…
Reference in New Issue