mirror of https://github.com/golang/go.git
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:
parent
09f1ddb158
commit
4a3071696d
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue