From 938d512f49f3b50507aaf46f604e15157de67107 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Thu, 11 Aug 2016 21:53:27 -0700 Subject: [PATCH] Not running tests parallal --- api/api_test.go | 11 ----------- client/driver/driver_test.go | 3 --- client/driver/exec_test.go | 7 ------- client/driver/java_test.go | 5 ----- client/driver/qemu_test.go | 3 --- client/driver/raw_exec_test.go | 6 ------ nomad/periodic_test.go | 14 -------------- 7 files changed, 49 deletions(-) diff --git a/api/api_test.go b/api/api_test.go index 8f27dc7bd..a64e29e1a 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -22,13 +22,6 @@ func init() { func makeClient(t *testing.T, cb1 configCallback, cb2 testutil.ServerConfigCallback) (*Client, *testutil.TestServer) { - // Always run these tests in parallel. Check if we have already - // marked the current test, as more than 1 call causes panics. - if _, ok := seen[t]; !ok { - seen[t] = struct{}{} - t.Parallel() - } - // Make client config conf := DefaultConfig() if cb1 != nil { @@ -49,7 +42,6 @@ func makeClient(t *testing.T, cb1 configCallback, } func TestRequestTime(t *testing.T) { - t.Parallel() srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { time.Sleep(100 * time.Millisecond) d, err := json.Marshal(struct{ Done bool }{true}) @@ -97,7 +89,6 @@ func TestRequestTime(t *testing.T) { } func TestDefaultConfig_env(t *testing.T) { - t.Parallel() url := "http://1.2.3.4:5678" os.Setenv("NOMAD_ADDR", url) @@ -175,7 +166,6 @@ func TestRequestToHTTP(t *testing.T) { } func TestParseQueryMeta(t *testing.T) { - t.Parallel() resp := &http.Response{ Header: make(map[string][]string), } @@ -200,7 +190,6 @@ func TestParseQueryMeta(t *testing.T) { } func TestParseWriteMeta(t *testing.T) { - t.Parallel() resp := &http.Response{ Header: make(map[string][]string), } diff --git a/client/driver/driver_test.go b/client/driver/driver_test.go index c8b37dda4..312f2748b 100644 --- a/client/driver/driver_test.go +++ b/client/driver/driver_test.go @@ -93,7 +93,6 @@ func testDriverContexts(task *structs.Task) (*DriverContext, *ExecContext) { } func TestDriver_GetTaskEnv(t *testing.T) { - t.Parallel() task := &structs.Task{ Name: "Foo", Env: map[string]string{ @@ -162,7 +161,6 @@ func TestDriver_GetTaskEnv(t *testing.T) { } func TestMapMergeStrInt(t *testing.T) { - t.Parallel() a := map[string]int{ "cakes": 5, "cookies": 3, @@ -187,7 +185,6 @@ func TestMapMergeStrInt(t *testing.T) { } func TestMapMergeStrStr(t *testing.T) { - t.Parallel() a := map[string]string{ "cake": "chocolate", "cookie": "caramel", diff --git a/client/driver/exec_test.go b/client/driver/exec_test.go index 103267323..2f4a1a220 100644 --- a/client/driver/exec_test.go +++ b/client/driver/exec_test.go @@ -21,7 +21,6 @@ import ( ) func TestExecDriver_Fingerprint(t *testing.T) { - t.Parallel() ctestutils.ExecCompatible(t) driverCtx, _ := testDriverContexts(&structs.Task{Name: "foo"}) d := NewExecDriver(driverCtx) @@ -43,7 +42,6 @@ func TestExecDriver_Fingerprint(t *testing.T) { } func TestExecDriver_StartOpen_Wait(t *testing.T) { - t.Parallel() ctestutils.ExecCompatible(t) task := &structs.Task{ Name: "sleep", @@ -84,7 +82,6 @@ func TestExecDriver_StartOpen_Wait(t *testing.T) { } func TestExecDriver_KillUserPid_OnPluginReconnectFailure(t *testing.T) { - t.Parallel() ctestutils.ExecCompatible(t) task := &structs.Task{ Name: "sleep", @@ -145,7 +142,6 @@ func TestExecDriver_KillUserPid_OnPluginReconnectFailure(t *testing.T) { } func TestExecDriver_Start_Wait(t *testing.T) { - t.Parallel() ctestutils.ExecCompatible(t) task := &structs.Task{ Name: "sleep", @@ -190,7 +186,6 @@ func TestExecDriver_Start_Wait(t *testing.T) { } func TestExecDriver_Start_Wait_AllocDir(t *testing.T) { - t.Parallel() ctestutils.ExecCompatible(t) exp := []byte{'w', 'i', 'n'} @@ -246,7 +241,6 @@ func TestExecDriver_Start_Wait_AllocDir(t *testing.T) { } func TestExecDriver_Start_Kill_Wait(t *testing.T) { - t.Parallel() ctestutils.ExecCompatible(t) task := &structs.Task{ Name: "sleep", @@ -294,7 +288,6 @@ func TestExecDriver_Start_Kill_Wait(t *testing.T) { } func TestExecDriverUser(t *testing.T) { - t.Parallel() ctestutils.ExecCompatible(t) task := &structs.Task{ Name: "sleep", diff --git a/client/driver/java_test.go b/client/driver/java_test.go index 5daad2580..1f8541776 100644 --- a/client/driver/java_test.go +++ b/client/driver/java_test.go @@ -30,7 +30,6 @@ func javaLocated() bool { // The fingerprinter test should always pass, even if Java is not installed. func TestJavaDriver_Fingerprint(t *testing.T) { - t.Parallel() ctestutils.JavaCompatible(t) driverCtx, _ := testDriverContexts(&structs.Task{Name: "foo"}) d := NewJavaDriver(driverCtx) @@ -61,7 +60,6 @@ func TestJavaDriver_Fingerprint(t *testing.T) { } func TestJavaDriver_StartOpen_Wait(t *testing.T) { - t.Parallel() if !javaLocated() { t.Skip("Java not found; skipping") } @@ -114,7 +112,6 @@ func TestJavaDriver_StartOpen_Wait(t *testing.T) { } func TestJavaDriver_Start_Wait(t *testing.T) { - t.Parallel() if !javaLocated() { t.Skip("Java not found; skipping") } @@ -176,7 +173,6 @@ func TestJavaDriver_Start_Wait(t *testing.T) { } func TestJavaDriver_Start_Kill_Wait(t *testing.T) { - t.Parallel() if !javaLocated() { t.Skip("Java not found; skipping") } @@ -235,7 +231,6 @@ func TestJavaDriver_Start_Kill_Wait(t *testing.T) { } func TestJavaDriverUser(t *testing.T) { - t.Parallel() if !javaLocated() { t.Skip("Java not found; skipping") } diff --git a/client/driver/qemu_test.go b/client/driver/qemu_test.go index 23dfcff1c..50def9a4b 100644 --- a/client/driver/qemu_test.go +++ b/client/driver/qemu_test.go @@ -14,7 +14,6 @@ import ( // The fingerprinter test should always pass, even if QEMU is not installed. func TestQemuDriver_Fingerprint(t *testing.T) { - t.Parallel() ctestutils.QemuCompatible(t) driverCtx, _ := testDriverContexts(&structs.Task{Name: "foo"}) d := NewQemuDriver(driverCtx) @@ -37,7 +36,6 @@ func TestQemuDriver_Fingerprint(t *testing.T) { } func TestQemuDriver_StartOpen_Wait(t *testing.T) { - t.Parallel() ctestutils.QemuCompatible(t) task := &structs.Task{ Name: "linux", @@ -96,7 +94,6 @@ func TestQemuDriver_StartOpen_Wait(t *testing.T) { } func TestQemuDriverUser(t *testing.T) { - t.Parallel() ctestutils.QemuCompatible(t) task := &structs.Task{ Name: "linux", diff --git a/client/driver/raw_exec_test.go b/client/driver/raw_exec_test.go index 9ebfb3315..23b5bf42e 100644 --- a/client/driver/raw_exec_test.go +++ b/client/driver/raw_exec_test.go @@ -17,7 +17,6 @@ import ( ) func TestRawExecDriver_Fingerprint(t *testing.T) { - t.Parallel() driverCtx, _ := testDriverContexts(&structs.Task{Name: "foo"}) d := NewRawExecDriver(driverCtx) node := &structs.Node{ @@ -53,7 +52,6 @@ func TestRawExecDriver_Fingerprint(t *testing.T) { } func TestRawExecDriver_StartOpen_Wait(t *testing.T) { - t.Parallel() task := &structs.Task{ Name: "sleep", Config: map[string]interface{}{ @@ -99,7 +97,6 @@ func TestRawExecDriver_StartOpen_Wait(t *testing.T) { } func TestRawExecDriver_Start_Wait(t *testing.T) { - t.Parallel() task := &structs.Task{ Name: "sleep", Config: map[string]interface{}{ @@ -143,7 +140,6 @@ func TestRawExecDriver_Start_Wait(t *testing.T) { } func TestRawExecDriver_Start_Wait_AllocDir(t *testing.T) { - t.Parallel() exp := []byte{'w', 'i', 'n'} file := "output.txt" outPath := fmt.Sprintf(`${%s}/%s`, env.AllocDir, file) @@ -199,7 +195,6 @@ func TestRawExecDriver_Start_Wait_AllocDir(t *testing.T) { } func TestRawExecDriver_Start_Kill_Wait(t *testing.T) { - t.Parallel() task := &structs.Task{ Name: "sleep", Config: map[string]interface{}{ @@ -248,7 +243,6 @@ func TestRawExecDriver_Start_Kill_Wait(t *testing.T) { } func TestRawExecDriverUser(t *testing.T) { - t.Parallel() task := &structs.Task{ Name: "sleep", User: "alice", diff --git a/nomad/periodic_test.go b/nomad/periodic_test.go index 10219d0ad..bcc5282c3 100644 --- a/nomad/periodic_test.go +++ b/nomad/periodic_test.go @@ -98,7 +98,6 @@ func testPeriodicJob(times ...time.Time) *structs.Job { } func TestPeriodicDispatch_Add_NonPeriodic(t *testing.T) { - t.Parallel() p, _ := testPeriodicDispatcher() job := mock.Job() if err := p.Add(job); err != nil { @@ -112,7 +111,6 @@ func TestPeriodicDispatch_Add_NonPeriodic(t *testing.T) { } func TestPeriodicDispatch_Add_UpdateJob(t *testing.T) { - t.Parallel() p, _ := testPeriodicDispatcher() job := mock.PeriodicJob() if err := p.Add(job); err != nil { @@ -141,7 +139,6 @@ func TestPeriodicDispatch_Add_UpdateJob(t *testing.T) { } func TestPeriodicDispatch_Add_RemoveJob(t *testing.T) { - t.Parallel() p, _ := testPeriodicDispatcher() job := mock.PeriodicJob() if err := p.Add(job); err != nil { @@ -166,7 +163,6 @@ func TestPeriodicDispatch_Add_RemoveJob(t *testing.T) { } func TestPeriodicDispatch_Add_TriggersUpdate(t *testing.T) { - t.Parallel() p, m := testPeriodicDispatcher() // Create a job that won't be evalauted for a while. @@ -205,7 +201,6 @@ func TestPeriodicDispatch_Add_TriggersUpdate(t *testing.T) { } func TestPeriodicDispatch_Remove_Untracked(t *testing.T) { - t.Parallel() p, _ := testPeriodicDispatcher() if err := p.Remove("foo"); err != nil { t.Fatalf("Remove failed %v; expected a no-op", err) @@ -213,7 +208,6 @@ func TestPeriodicDispatch_Remove_Untracked(t *testing.T) { } func TestPeriodicDispatch_Remove_Tracked(t *testing.T) { - t.Parallel() p, _ := testPeriodicDispatcher() job := mock.PeriodicJob() @@ -237,7 +231,6 @@ func TestPeriodicDispatch_Remove_Tracked(t *testing.T) { } func TestPeriodicDispatch_Remove_TriggersUpdate(t *testing.T) { - t.Parallel() p, _ := testPeriodicDispatcher() // Create a job that will be evaluated soon. @@ -263,7 +256,6 @@ func TestPeriodicDispatch_Remove_TriggersUpdate(t *testing.T) { } func TestPeriodicDispatch_ForceRun_Untracked(t *testing.T) { - t.Parallel() p, _ := testPeriodicDispatcher() if _, err := p.ForceRun("foo"); err == nil { @@ -272,7 +264,6 @@ func TestPeriodicDispatch_ForceRun_Untracked(t *testing.T) { } func TestPeriodicDispatch_ForceRun_Tracked(t *testing.T) { - t.Parallel() p, m := testPeriodicDispatcher() // Create a job that won't be evalauted for a while. @@ -301,7 +292,6 @@ func TestPeriodicDispatch_ForceRun_Tracked(t *testing.T) { } func TestPeriodicDispatch_Run_DisallowOverlaps(t *testing.T) { - t.Parallel() p, m := testPeriodicDispatcher() // Create a job that will trigger two launches but disallows overlapping. @@ -331,7 +321,6 @@ func TestPeriodicDispatch_Run_DisallowOverlaps(t *testing.T) { } func TestPeriodicDispatch_Run_Multiple(t *testing.T) { - t.Parallel() p, m := testPeriodicDispatcher() // Create a job that will be launched twice. @@ -363,7 +352,6 @@ func TestPeriodicDispatch_Run_Multiple(t *testing.T) { } func TestPeriodicDispatch_Run_SameTime(t *testing.T) { - t.Parallel() p, m := testPeriodicDispatcher() // Create two job that will be launched at the same time. @@ -400,7 +388,6 @@ func TestPeriodicDispatch_Run_SameTime(t *testing.T) { // some after each other and some invalid times, and ensures the correct // behavior. func TestPeriodicDispatch_Complex(t *testing.T) { - t.Parallel() p, m := testPeriodicDispatcher() // Create some jobs launching at different times. @@ -484,7 +471,6 @@ func shuffle(jobs []*structs.Job) { } func TestPeriodicHeap_Order(t *testing.T) { - t.Parallel() h := NewPeriodicHeap() j1 := mock.PeriodicJob() j2 := mock.PeriodicJob()