mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Revert the workaround needed to cleanup for Ginkgo V1
Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
parent
b0d5769535
commit
6a82ba82b1
@ -98,11 +98,6 @@ type Framework struct {
|
|||||||
// Flaky operation failures in an e2e test can be captured through this.
|
// Flaky operation failures in an e2e test can be captured through this.
|
||||||
flakeReport *FlakeReport
|
flakeReport *FlakeReport
|
||||||
|
|
||||||
// To make sure that this framework cleans up after itself, no matter what,
|
|
||||||
// we install a Cleanup action before each test and clear it after. If we
|
|
||||||
// should abort, the AfterSuite hook should run all Cleanup actions.
|
|
||||||
cleanupHandle CleanupActionHandle
|
|
||||||
|
|
||||||
// afterEaches is a map of name to function to be called after each test. These are not
|
// afterEaches is a map of name to function to be called after each test. These are not
|
||||||
// cleared. The call order is randomized so that no dependencies can grow between
|
// cleared. The call order is randomized so that no dependencies can grow between
|
||||||
// the various afterEaches
|
// the various afterEaches
|
||||||
@ -193,9 +188,6 @@ func NewFramework(baseName string, options Options, client clientset.Interface)
|
|||||||
func (f *Framework) BeforeEach() {
|
func (f *Framework) BeforeEach() {
|
||||||
f.beforeEachStarted = true
|
f.beforeEachStarted = true
|
||||||
|
|
||||||
// The fact that we need this feels like a bug in ginkgo.
|
|
||||||
// https://github.com/onsi/ginkgo/v2/issues/222
|
|
||||||
f.cleanupHandle = AddCleanupAction(f.AfterEach)
|
|
||||||
if f.ClientSet == nil {
|
if f.ClientSet == nil {
|
||||||
ginkgo.By("Creating a kubernetes client")
|
ginkgo.By("Creating a kubernetes client")
|
||||||
config, err := LoadConfig()
|
config, err := LoadConfig()
|
||||||
@ -375,8 +367,6 @@ func (f *Framework) AfterEach() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveCleanupAction(f.cleanupHandle)
|
|
||||||
|
|
||||||
// This should not happen. Given ClientSet is a public field a test must have updated it!
|
// This should not happen. Given ClientSet is a public field a test must have updated it!
|
||||||
// Error out early before any API calls during cleanup.
|
// Error out early before any API calls during cleanup.
|
||||||
if f.ClientSet == nil {
|
if f.ClientSet == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user