]> Cypherpunks repositories - gostls13.git/commitdiff
sync: fix TestCondSignalStealing flake
authorCollin Wright <1011collin@gmail.com>
Mon, 20 Mar 2023 23:27:04 +0000 (23:27 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 22 Mar 2023 18:52:42 +0000 (18:52 +0000)
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 <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>

src/sync/cond_test.go

index 859cae59bca829aaaa3ab8e3a8465c02c241a89e..aa134e3c1d167d06ad84aaf049245d71153455fa 100644 (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.