@@ -341,7 +341,7 @@ func TestServerCleanup(f *framework.Framework, config TestConfig) {
341
341
gomega .Expect (err ).To (gomega .BeNil (), "Failed to delete pod %v in namespace %v" , config .Prefix + "-server" , config .Namespace )
342
342
}
343
343
344
- func runVolumeTesterPod (client clientset.Interface , config TestConfig , podSuffix string , privileged bool , fsGroup * int64 , tests []Test ) (* v1.Pod , error ) {
344
+ func runVolumeTesterPod (client clientset.Interface , config TestConfig , podSuffix string , privileged bool , fsGroup * int64 , tests []Test , slow bool ) (* v1.Pod , error ) {
345
345
ginkgo .By (fmt .Sprint ("starting " , config .Prefix , "-" , podSuffix ))
346
346
var gracePeriod int64 = 1
347
347
var command string
@@ -417,8 +417,13 @@ func runVolumeTesterPod(client clientset.Interface, config TestConfig, podSuffix
417
417
if err != nil {
418
418
return nil , err
419
419
}
420
- err = e2epod .WaitForPodRunningInNamespace (client , clientPod )
420
+ if slow {
421
+ err = e2epod .WaitForPodRunningInNamespaceSlow (client , clientPod .Name , clientPod .Namespace )
422
+ } else {
423
+ err = e2epod .WaitForPodRunningInNamespace (client , clientPod )
424
+ }
421
425
if err != nil {
426
+ e2epod .DeletePodOrFail (client , clientPod .Namespace , clientPod .Name )
422
427
e2epod .WaitForPodToDisappear (client , clientPod .Namespace , clientPod .Name , labels .Everything (), framework .Poll , framework .PodDeleteTimeout )
423
428
return nil , err
424
429
}
@@ -471,8 +476,24 @@ func testVolumeContent(f *framework.Framework, pod *v1.Pod, fsGroup *int64, fsTy
471
476
// and check that the pod sees expected data, e.g. from the server pod.
472
477
// Multiple Tests can be specified to mount multiple volumes to a single
473
478
// pod.
479
+ // Timeout for dynamic provisioning (if "WaitForFirstConsumer" is set && provided PVC is not bound yet),
480
+ // pod creation, scheduling and complete pod startup (incl. volume attach & mount) is pod.podStartTimeout.
481
+ // It should be used for cases where "regular" dynamic provisioning of an empty volume is requested.
474
482
func TestVolumeClient (f * framework.Framework , config TestConfig , fsGroup * int64 , fsType string , tests []Test ) {
475
- clientPod , err := runVolumeTesterPod (f .ClientSet , config , "client" , false , fsGroup , tests )
483
+ testVolumeClient (f , config , fsGroup , fsType , tests , false )
484
+ }
485
+
486
+ // TestVolumeClientSlow is the same as TestVolumeClient except for its timeout.
487
+ // Timeout for dynamic provisioning (if "WaitForFirstConsumer" is set && provided PVC is not bound yet),
488
+ // pod creation, scheduling and complete pod startup (incl. volume attach & mount) is pod.slowPodStartTimeout.
489
+ // It should be used for cases where "special" dynamic provisioning is requested, such as volume cloning
490
+ // or snapshot restore.
491
+ func TestVolumeClientSlow (f * framework.Framework , config TestConfig , fsGroup * int64 , fsType string , tests []Test ) {
492
+ testVolumeClient (f , config , fsGroup , fsType , tests , true )
493
+ }
494
+
495
+ func testVolumeClient (f * framework.Framework , config TestConfig , fsGroup * int64 , fsType string , tests []Test , slow bool ) {
496
+ clientPod , err := runVolumeTesterPod (f .ClientSet , config , "client" , false , fsGroup , tests , slow )
476
497
if err != nil {
477
498
framework .Failf ("Failed to create client pod: %v" , err )
478
499
}
@@ -481,7 +502,6 @@ func TestVolumeClient(f *framework.Framework, config TestConfig, fsGroup *int64,
481
502
e2epod .WaitForPodToDisappear (f .ClientSet , clientPod .Namespace , clientPod .Name , labels .Everything (), framework .Poll , framework .PodDeleteTimeout )
482
503
}()
483
504
484
- framework .ExpectNoError (e2epod .WaitForPodRunningInNamespace (f .ClientSet , clientPod ))
485
505
testVolumeContent (f , clientPod , fsGroup , fsType , tests )
486
506
}
487
507
@@ -493,7 +513,7 @@ func InjectContent(f *framework.Framework, config TestConfig, fsGroup *int64, fs
493
513
if framework .NodeOSDistroIs ("windows" ) {
494
514
privileged = false
495
515
}
496
- injectorPod , err := runVolumeTesterPod (f .ClientSet , config , "injector" , privileged , fsGroup , tests )
516
+ injectorPod , err := runVolumeTesterPod (f .ClientSet , config , "injector" , privileged , fsGroup , tests , false /*slow*/ )
497
517
if err != nil {
498
518
framework .Failf ("Failed to create injector pod: %v" , err )
499
519
return
0 commit comments