Skip to content

Commit 7a013ed

Browse files
authored
Merge pull request #592 from kzys/multiple-vm-timeout
Remove TestMultipleVMs_Isolated's timeout
2 parents d659a45 + 69d69b1 commit 7a013ed

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

runtime/service_integ_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,12 @@ func createTapDevice(ctx context.Context, tapName string) error {
251251
func TestMultipleVMs_Isolated(t *testing.T) {
252252
prepareIntegTest(t)
253253

254+
// This test starts multiple VMs and some may hit firecracker-containerd's
255+
// default timeout. So overriding the timeout to wait longer.
256+
// One hour should be enough to start a VM, regardless of the load of
257+
// the underlying host.
258+
const createVMTimeout = time.Hour
259+
254260
netns, err := ns.GetCurrentNS()
255261
require.NoError(t, err, "failed to get a namespace")
256262

@@ -290,9 +296,7 @@ func TestMultipleVMs_Isolated(t *testing.T) {
290296
},
291297
}
292298

293-
testTimeout := 10 * time.Minute
294-
testCtx, cancel := context.WithTimeout(namespaces.WithNamespace(context.Background(), defaultNamespace), testTimeout)
295-
defer cancel()
299+
testCtx := namespaces.WithNamespace(context.Background(), defaultNamespace)
296300

297301
client, err := containerd.New(containerdSockPath, containerd.WithDefaultRuntime(firecrackerRuntime))
298302
require.NoError(t, err, "unable to create client to containerd service at %s, is containerd running?", containerdSockPath)
@@ -346,15 +350,11 @@ func TestMultipleVMs_Isolated(t *testing.T) {
346350
},
347351
ContainerCount: containerCount,
348352
JailerConfig: jailerConfig,
353+
TimeoutSeconds: uint32(createVMTimeout / time.Second),
349354
// In tests, our in-VM agent has Go's race detector,
350355
// which makes the agent resource-hoggy than its production build
351356
// So the default VM size (128MB) is too small.
352357
MachineCfg: &proto.FirecrackerMachineConfiguration{MemSizeMib: 1024},
353-
// CreateVM's default timeout is 20 seconds and it cannot be
354-
// disabled.
355-
// However because this test starts multiple VMs in parallel,
356-
// some of them may not start within the default timeout.
357-
TimeoutSeconds: 300,
358358
}
359359

360360
resp, createVMErr := fcClient.CreateVM(ctx, req)

0 commit comments

Comments
 (0)