From 4eabc1cc16118255ad8c8274d61e1e7a99f940f7 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Fri, 15 Mar 2019 03:59:44 +0200 Subject: [PATCH] Revert "Speculative workaround for #74890" --- test/e2e/lifecycle/cluster_upgrade.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/test/e2e/lifecycle/cluster_upgrade.go b/test/e2e/lifecycle/cluster_upgrade.go index 50f054fed38..a3a0a730af2 100644 --- a/test/e2e/lifecycle/cluster_upgrade.go +++ b/test/e2e/lifecycle/cluster_upgrade.go @@ -24,7 +24,7 @@ import ( "path/filepath" "regexp" "strings" - "sync/atomic" + "sync" "time" "k8s.io/apimachinery/pkg/util/version" @@ -434,19 +434,11 @@ type chaosMonkeyAdapter struct { func (cma *chaosMonkeyAdapter) Test(sem *chaosmonkey.Semaphore) { start := time.Now() - - // Using an atomic with a CAS is a potential workaround for #74890. - // - // This is a speculative workaround - we are really seeing if - // this is better; if not we should revert. - // - // If it is better we should file a bug against go 1.12, and - // then revert! - var onceWithoutMutex uint32 + var once sync.Once ready := func() { - if atomic.CompareAndSwapUint32(&onceWithoutMutex, 0, 1) { + once.Do(func() { sem.Ready() - } + }) } defer finalizeUpgradeTest(start, cma.testReport) defer ready()