mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-17 20:00:07 +00:00
Merge pull request #135570 from Karthik-K-N/fix-sidecar-flake
Fix TestTerminationOrderingSidecarStopAfterMain flake under stress
This commit is contained in:
@@ -55,9 +55,11 @@ func TestTerminationOrderingSidecarStopAfterMain(t *testing.T) {
|
||||
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
var sidecarWaitDelay int64
|
||||
var mainWaitDelay int64
|
||||
var sidecarWaitDelay, mainWaitDelay int64
|
||||
syncChannel := make(chan struct{})
|
||||
|
||||
go func() {
|
||||
close(syncChannel) // notifies other goroutine that this goroutine scheduled.
|
||||
sidecarWaitDelay = int64(to.waitForTurn("init", 30))
|
||||
to.containerTerminated("init")
|
||||
wg.Done()
|
||||
@@ -65,6 +67,7 @@ func TestTerminationOrderingSidecarStopAfterMain(t *testing.T) {
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
<-syncChannel // make sure the other goroutine is scheduled.
|
||||
mainWaitDelay = int64(to.waitForTurn("main", 0))
|
||||
time.Sleep(1 * time.Second)
|
||||
to.containerTerminated("main")
|
||||
|
||||
Reference in New Issue
Block a user