Skip to content

Commit a011813

Browse files
committed
Run TestCreateVM_Isolated's subtests in parallel
Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent 052c943 commit a011813

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

runtime/service_integ_test.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,10 +1921,11 @@ func TestCreateVM_Isolated(t *testing.T) {
19211921
fcClient := fccontrol.NewFirecrackerClient(pluginClient.Client())
19221922

19231923
type subtest struct {
1924-
name string
1925-
request proto.CreateVMRequest
1926-
validate func(*testing.T, error)
1927-
stopVM bool
1924+
name string
1925+
request proto.CreateVMRequest
1926+
validate func(*testing.T, error)
1927+
validateUsesFindProcess bool
1928+
stopVM bool
19281929
}
19291930

19301931
subtests := []subtest{
@@ -1951,7 +1952,8 @@ func TestCreateVM_Isolated(t *testing.T) {
19511952
require.NoError(t, err, "failed waiting for expected firecracker process %q to come up", firecrackerProcessName)
19521953
require.Len(t, firecrackerProcesses, 0, "expected only no firecracker processes to exist")
19531954
},
1954-
stopVM: false,
1955+
validateUsesFindProcess: true,
1956+
stopVM: false,
19551957
},
19561958
{
19571959
name: "Slow Root FS",
@@ -1983,6 +1985,12 @@ func TestCreateVM_Isolated(t *testing.T) {
19831985
}
19841986

19851987
runTest := func(t *testing.T, request proto.CreateVMRequest, s subtest) {
1988+
// If this test checks the number of the processes on the host
1989+
// (e.g. the number of Firecracker processes), running the test with
1990+
// others in parallel messes up the result.
1991+
if !s.validateUsesFindProcess {
1992+
t.Parallel()
1993+
}
19861994
vmID := testNameToVMID(t.Name())
19871995

19881996
tempDir, err := ioutil.TempDir("", vmID)

0 commit comments

Comments
 (0)