ordering issue

This commit is contained in:
Alex Dadgar 2016-01-21 13:28:48 -08:00
parent 9656714f4e
commit a4ddfc306b
2 changed files with 9 additions and 2 deletions

View file

@ -306,7 +306,9 @@ func TestRawExecDriver_Start_Kill_Wait(t *testing.T) {
go func() {
time.Sleep(1 * time.Second)
err := handle.Kill()
if err != nil {
// Can't rely on the ordering between wait and kill on travis...
if !testutil.IsTravis() && err != nil {
t.Fatalf("err: %v", err)
}
}()

View file

@ -40,13 +40,18 @@ func WaitForResultRetries(retries int64, test testFn, error errorFn) {
// TestMultiplier returns a multiplier for retries and waits given environment
// the tests are being run under.
func TestMultiplier() int64 {
if _, ok := os.LookupEnv(TravisRunEnv); ok {
if IsTravis() {
return 3
}
return 1
}
func IsTravis() bool {
_, ok := os.LookupEnv(TravisRunEnv)
return ok
}
type rpcFn func(string, interface{}, interface{}) error
func WaitForLeader(t *testing.T, rpc rpcFn) {