@@ -251,6 +251,12 @@ func createTapDevice(ctx context.Context, tapName string) error {
251
251
func TestMultipleVMs_Isolated (t * testing.T ) {
252
252
prepareIntegTest (t )
253
253
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
+
254
260
netns , err := ns .GetCurrentNS ()
255
261
require .NoError (t , err , "failed to get a namespace" )
256
262
@@ -290,9 +296,7 @@ func TestMultipleVMs_Isolated(t *testing.T) {
290
296
},
291
297
}
292
298
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 )
296
300
297
301
client , err := containerd .New (containerdSockPath , containerd .WithDefaultRuntime (firecrackerRuntime ))
298
302
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) {
346
350
},
347
351
ContainerCount : containerCount ,
348
352
JailerConfig : jailerConfig ,
353
+ TimeoutSeconds : uint32 (createVMTimeout / time .Second ),
349
354
// In tests, our in-VM agent has Go's race detector,
350
355
// which makes the agent resource-hoggy than its production build
351
356
// So the default VM size (128MB) is too small.
352
357
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 ,
358
358
}
359
359
360
360
resp , createVMErr := fcClient .CreateVM (ctx , req )
0 commit comments