mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-26 19:35:10 +00:00
e2e: skip AllNodesReady when the test skipped framework initialization
This addresses a problem caused by https://github.com/kubernetes/kubernetes/pull/112043: because the AfterEach which invokes AllNodesReady always runs, including tests that skipped early, those tests ran into a nil pointer access. This increased the size of log files. The tests still worked.
This commit is contained in:
@@ -30,6 +30,12 @@ func init() {
|
||||
framework.NewFrameworkExtensions = append(framework.NewFrameworkExtensions,
|
||||
func(f *framework.Framework) {
|
||||
ginkgo.AfterEach(func() {
|
||||
if f.ClientSet == nil {
|
||||
// Test didn't reach f.BeforeEach, most
|
||||
// likely because the test got
|
||||
// skipped. Nothing to check...
|
||||
return
|
||||
}
|
||||
e2enode.AllNodesReady(f.ClientSet, 3*time.Minute)
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user