Merge pull request #135570 from Karthik-K-N/fix-sidecar-flake

Fix TestTerminationOrderingSidecarStopAfterMain flake under stress
This commit is contained in:
Kubernetes Prow Robot
2026-01-22 07:57:26 +05:30
committed by GitHub

View File

@@ -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")