@@ -251,6 +251,12 @@ func createTapDevice(ctx context.Context, tapName string) error {
251251func 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