sync: fix TestCondSignalStealing flake

Fixes: #59043

Change-Id: I8215948a772566641dab1079a9837128450deb1b
GitHub-Last-Rev: 0fa6f08a70
GitHub-Pull-Request: golang/go#59160
Reviewed-on: https://go-review.googlesource.com/c/go/+/477955
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
This commit is contained in:
Collin Wright 2023-03-20 23:27:04 +00:00 committed by Gopher Robot
parent 09f1ddb158
commit 4a3071696d
1 changed files with 1 additions and 6 deletions

View File

@ -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.