From: Collin Wright <1011collin@gmail.com> Date: Mon, 20 Mar 2023 23:27:04 +0000 (+0000) Subject: sync: fix TestCondSignalStealing flake X-Git-Tag: go1.21rc1~1185 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4a3071696ddfb13e1a8f35f76197b7b3143492f4;p=gostls13.git sync: fix TestCondSignalStealing flake Fixes: #59043 Change-Id: I8215948a772566641dab1079a9837128450deb1b GitHub-Last-Rev: 0fa6f08a70658e1272da0c82812de752350d394d GitHub-Pull-Request: golang/go#59160 Reviewed-on: https://go-review.googlesource.com/c/go/+/477955 Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Reviewed-by: Bryan Mills Auto-Submit: Bryan Mills --- diff --git a/src/sync/cond_test.go b/src/sync/cond_test.go index 859cae59bc..aa134e3c1d 100644 --- a/src/sync/cond_test.go +++ b/src/sync/cond_test.go @@ -9,7 +9,6 @@ import ( "runtime" . "sync" "testing" - "time" ) func TestCondSignal(t *testing.T) { @@ -228,11 +227,7 @@ func TestCondSignalStealing(t *testing.T) { }() // Check that the first waiter does get signaled. - select { - case <-ch: - case <-time.After(2 * time.Second): - t.Fatalf("First waiter didn't get broadcast.") - } + <-ch // Release the second waiter in case it didn't get the // broadcast.