Stop using the deprecated method CurrentGinkgoTestDescription

Besides, the using of method might lead to a `concurrent map writes`
issue per the discussion here: https://github.com/onsi/ginkgo/issues/970

Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
Dave Chen
2022-04-24 16:55:25 +08:00
parent 2f3028c00d
commit fd4b5b629b
18 changed files with 40 additions and 34 deletions

View File

@@ -22,7 +22,7 @@ import (
"strconv"
"time"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
internalapi "k8s.io/cri-api/pkg/apis"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
@@ -264,7 +264,7 @@ func containerGCTest(f *framework.Framework, test testRun) {
return nil
}, garbageCollectDuration, runtimePollInterval).Should(gomega.BeNil())
if ginkgo.CurrentGinkgoTestDescription().Failed && framework.TestContext.DumpLogsOnFailure {
if ginkgo.CurrentSpecReport().Failed() && framework.TestContext.DumpLogsOnFailure {
logNodeEvents(f)
logPodEvents(f)
}