]> Cypherpunks.ru repositories - gostls13.git/commitdiff
runtime: remove an arbitrary timeout in TestProfBuf
authorBryan C. Mills <bcmills@google.com>
Fri, 15 Sep 2023 14:56:32 +0000 (10:56 -0400)
committerBryan Mills <bcmills@google.com>
Fri, 15 Sep 2023 20:04:56 +0000 (20:04 +0000)
The failure observed in
https://build.golang.org/log/766ad55d098ee1979ba1ae261e0813063567743e
appears to be spurious. If it is, this change will fix it.

If it is not, and somehow the Read has deadlocked,
then this change will help to diagnose it
(by causing the test to time out and dump its running goroutines).

For #56196.

Change-Id: Ic74f018384a64e95566a5b5d8126cbd59ab5e5fa
Reviewed-on: https://go-review.googlesource.com/c/go/+/528399
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>

src/runtime/profbuf_test.go

index d9c5264b732d6857c44b2eb35ce10ab0324c0025..dac78ffd31bfef2297441cf9b7f0f0ce4cdeb7c0 100644 (file)
@@ -39,13 +39,7 @@ func TestProfBuf(t *testing.T) {
                        c <- 1
                }()
                time.Sleep(10 * time.Millisecond) // let goroutine run and block
-               return func() {
-                       select {
-                       case <-c:
-                       case <-time.After(1 * time.Second):
-                               t.Fatalf("timeout waiting for blocked read")
-                       }
-               }
+               return func() { <-c }
        }
        readEOF := func(t *testing.T, b *ProfBuf) {
                rdata, rtags, eof := b.Read(ProfBufBlocking)