Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal/singleflight: flaky TestDoDupSuppress #11475

Closed
mikioh opened this issue Jun 29, 2015 · 3 comments
Closed

internal/singleflight: flaky TestDoDupSuppress #11475

mikioh opened this issue Jun 29, 2015 · 3 comments
Milestone

Comments

@mikioh
Copy link
Contributor

mikioh commented Jun 29, 2015

See http://build.golang.org/log/683c92f5ad9b397c36b9e6bcd3d457e70a2eca59.
The singleflight.Group.Do didn't return?

panic: test timed out after 2m0s

goroutine 33 [running]:
testing.startAlarm.func1()
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/testing/testing.go:702 +0x132
created by time.goFunc
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/time/sleep.go:129 +0x3a

goroutine 1 [chan receive]:
testing.RunTests(0x5d7908, 0x6606c0, 0x3, 0x3, 0x1)
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/testing/testing.go:561 +0x8ad
testing.(*M).Run(0xc82003fef8, 0xc82000e640)
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/testing/testing.go:493 +0x70
main.main()
    internal/singleflight/_test/_testmain.go:58 +0x116

goroutine 8 [semacquire]:
sync.runtime_Semacquire(0xc82000e7ac)
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/runtime/sema.go:43 +0x26
sync.(*WaitGroup).Wait(0xc82000e7a0)
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/sync/waitgroup.go:126 +0xb4
internal/singleflight.TestDoDupSuppress(0xc8200101b0)
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/internal/singleflight/singleflight_test.go:69 +0x1c6
testing.tRunner(0xc8200101b0, 0x6606f0)
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/testing/testing.go:455 +0x98
created by testing.RunTests
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/testing/testing.go:560 +0x86d

goroutine 10 [chan receive]:
internal/singleflight.TestDoDupSuppress.func1(0x0, 0x0, 0x0, 0x0)
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/internal/singleflight/singleflight_test.go:49 +0x7d
internal/singleflight.(*Group).doCall(0xc82000e780, 0xc8200bc000, 0x58b150, 0x3, 0xc820016060)
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/internal/singleflight/singleflight.go:93 +0x2c
internal/singleflight.(*Group).Do(0xc82000e780, 0x58b150, 0x3, 0xc820016060, 0x0, 0x0, 0x0, 0x0, 0x0)
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/internal/singleflight/singleflight.go:63 +0x284
internal/singleflight.TestDoDupSuppress.func2(0xc82000e780, 0xc820016060, 0xc8200101b0, 0xc82000e7a0)
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/internal/singleflight/singleflight_test.go:57 +0x81
created by internal/singleflight.TestDoDupSuppress
    /tmp/gobuilder/dragonfly-amd64-69f0d4c6bebc/go/src/internal/singleflight/singleflight_test.go:65 +0x156
FAIL    internal/singleflight   120.020s
@mikioh mikioh added this to the Go1.5Maybe milestone Jun 29, 2015
@bradfitz
Copy link
Contributor

I can't reproduce this (tried many runs, and varying timing, GOMAXPROCS), the code looks fine, and this has been testing for years inside Google's build system for dl.google.com. I'm inclined to blame dragonfly somehow, even though that's lazy of me.

Hey, @dvyukov, have you ever reviewed this code? Maybe it is buggy.

@dvyukov
Copy link
Member

dvyukov commented Jun 30, 2015

@bradfitz I guess one of the goroutines in test did not block in 100ms.
It's easy to reproduce if you comment out the sleep.
The following sequence does not do what it is meant to do. If calls > 1, then wg.Wait won't return.

    wg.Wait()
    if got := atomic.LoadInt32(&calls); got != 1 {
        t.Errorf("number of calls = %d; want 1", got)
    }

@bradfitz bradfitz self-assigned this Jun 30, 2015
@gopherbot
Copy link

CL https://golang.org/cl/11770 mentions this issue.

@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Jul 1, 2015
@mikioh mikioh changed the title internal/singleflight: flaky TestDoDupSuppress? internal/singleflight: flaky TestDoDupSuppress Jul 2, 2015
@golang golang locked and limited conversation to collaborators Jul 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants