Skip QEMU graceful shutdown test except on Travis

Hopefully we can reuse the SkipSlow helper elsewhere.
This commit is contained in:
Michael Schurter 2018-01-31 15:47:26 -08:00
parent 24d060bbb4
commit 0ac43a7622
3 changed files with 19 additions and 2 deletions

View File

@ -125,12 +125,14 @@ func TestQemuDriver_StartOpen_Wait(t *testing.T) {
}
func TestQemuDriver_GracefulShutdown(t *testing.T) {
logger := testLogger()
testutil.SkipSlow(t)
if !testutil.IsTravis() {
t.Parallel()
}
ctestutils.QemuCompatible(t)
logger := testLogger()
// Graceful shutdown may be really slow unfortunately
killTimeout := 3 * time.Minute

View File

@ -14,7 +14,7 @@ if [ "$RUN_STATIC_CHECKS" ]; then
fi
fi
make test
NOMAD_SLOW_TEST=1 make test
TEST_OUTPUT=$?
kill $PING_LOOP_PID

15
testutil/slow.go Normal file
View File

@ -0,0 +1,15 @@
package testutil
import (
"os"
testing "github.com/mitchellh/go-testing-interface"
)
// SkipSlow skips a slow test unless the NOMAD_SLOW_TEST environment variable
// is set.
func SkipSlow(t testing.T) {
if os.Getenv("NOMAD_SLOW_TEST") == "" {
t.Skip("Skipping slow test. Set NOMAD_SLOW_TEST=1 to run.")
}
}