Merge pull request #1341 from mlaventure/enable-test-parallelism
Enable test parallelism
This commit is contained in:
@@ -43,6 +43,8 @@ func TestContainerList(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNewContainer(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
id := t.Name()
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
@@ -79,6 +81,8 @@ func TestNewContainer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestContainerStart(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -150,6 +154,8 @@ func TestContainerStart(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestContainerOutput(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -224,6 +230,8 @@ func TestContainerOutput(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestContainerExec(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -321,6 +329,8 @@ func TestContainerExec(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestContainerPids(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -400,6 +410,8 @@ func TestContainerPids(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestContainerCloseIO(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -491,6 +503,8 @@ func TestContainerCloseIO(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestContainerAttach(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
if runtime.GOOS == "windows" {
|
||||
// On windows, closing the write side of the pipe closes the read
|
||||
// side, sending an EOF to it and preventing reopening it.
|
||||
@@ -624,6 +638,8 @@ func TestContainerAttach(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDeleteRunningContainer(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -693,6 +709,8 @@ func TestDeleteRunningContainer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestContainerKill(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -763,6 +781,8 @@ func TestContainerKill(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestContainerNoBinaryExists(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -784,7 +804,7 @@ func TestContainerNoBinaryExists(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
spec, err := generateSpec(withImageConfig(ctx, image), withProcessArgs("nothing"))
|
||||
spec, err := generateSpec(withImageConfig(ctx, image), WithProcessArgs("nothing"))
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
@@ -800,11 +820,11 @@ func TestContainerNoBinaryExists(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
if err != nil {
|
||||
t.Errorf("failed to create task %v", err)
|
||||
t.Fatalf("failed to create task %v", err)
|
||||
}
|
||||
if err := task.Start(ctx); err != nil {
|
||||
defer task.Delete(ctx, WithProcessKill)
|
||||
if err := task.Start(ctx); err == nil {
|
||||
t.Error("task.Start() should return an error when binary does not exist")
|
||||
task.Delete(ctx)
|
||||
}
|
||||
default:
|
||||
if err == nil {
|
||||
@@ -815,6 +835,8 @@ func TestContainerNoBinaryExists(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestContainerExecNoBinaryExists(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -890,6 +912,8 @@ func TestContainerExecNoBinaryExists(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUserNamespaces(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -968,6 +992,8 @@ func TestUserNamespaces(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestWaitStoppedTask(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -1038,6 +1064,8 @@ func TestWaitStoppedTask(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestWaitStoppedProcess(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -1133,6 +1161,8 @@ func TestWaitStoppedProcess(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTaskForceDelete(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -1184,6 +1214,8 @@ func TestTaskForceDelete(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestProcessForceDelete(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -1263,6 +1295,8 @@ func TestProcessForceDelete(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestContainerHostname(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user