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

runtime/pprof: TestCPUProfileMultithreaded has too few samples on Windows #10842

Closed
bradfitz opened this issue May 13, 2015 · 5 comments
Closed
Labels
FrozenDueToAge Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bradfitz
Copy link
Contributor

Random test failure:

windows-amd64-gce at 5c7f944
http://build.golang.org/log/135576b3d6ecdc234707e6e75b2829b9c6ea5bef

--- FAIL: TestCPUProfileMultithreaded (0.44s)
    pprof_test.go:164: total 4 CPU profile samples collected
    pprof_test.go:173: runtime/pprof_test.cpuHog1: 2
    pprof_test.go:173: runtime/pprof_test.cpuHog2: 0
    pprof_test.go:187: runtime/pprof_test.cpuHog2 has 0 samples out of 2, want at least 1, ideally 1
FAIL
FAIL    runtime/pprof   8.433s

No flaky tests are tolerated. Let's deflake or delete.

/cc @alexbrainman @dvyukov @minux

@bradfitz bradfitz added the Testing An issue that has been verified to require only test changes, not just a test failure. label May 13, 2015
@bradfitz bradfitz added this to the Go1.5 milestone May 13, 2015
@rsc
Copy link
Contributor

rsc commented Jul 21, 2015

The bigger problem here is that there were only 4 CPU samples collected in 0.44 seconds. That sounds like the sampling is doing 10 Hz instead of 100 Hz.

@rsc rsc changed the title runtime/pprof: TestCPUProfileMultithreaded is flaky on Windows runtime/pprof: TestCPUProfileMultithreaded has too few samples on Windows Jul 21, 2015
@alexbrainman
Copy link
Member

... That sounds like the sampling is doing 10 Hz instead of 100 Hz.

I suspect it is all what schedule does. Ours together with Windows scheduler. It varies between different environments - how many CPUs you have, whether you're running in VM or not.

My windows xp 386 2*CPU:

C:\>go test -v -run=TestCPUProfileMultithreaded runtime/pprof
=== RUN   TestCPUProfileMultithreaded
--- PASS: TestCPUProfileMultithreaded (0.27s)
        pprof_test.go:165: total 48 CPU profile samples collected
        pprof_test.go:174: runtime/pprof_test.cpuHog1: 24
        pprof_test.go:174: runtime/pprof_test.cpuHog2: 24
PASS
ok      runtime/pprof   0.453s

Another vm windows 7 amd64 1*CPU:

c:\>go test -v -run=TestCPUProfileMultithreaded runtime/pprof
=== RUN   TestCPUProfileMultithreaded
--- PASS: TestCPUProfileMultithreaded (0.35s)
        pprof_test.go:165: total 27 CPU profile samples collected
        pprof_test.go:174: runtime/pprof_test.cpuHog1: 16
        pprof_test.go:174: runtime/pprof_test.cpuHog2: 10
PASS
ok      runtime/pprof   0.395s

As far as I remember, I have seen numbers vary if your PC is busy doing other staff.

It has been a while since I have seen this issue on our builders.

Alex

@dvyukov
Copy link
Member

dvyukov commented Jul 21, 2015

Maybe timeBeginPeriod call failed in os1_windows.go? That would give 15ms timer precision instead of 1ms.

@gopherbot
Copy link

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

@rsc rsc closed this as completed in 3b26e8b Jul 22, 2015
@alexbrainman
Copy link
Member

Maybe timeBeginPeriod call failed in os1_windows.go?

No, it didn't - https://go-review.googlesource.com/#/c/12546/

Alex

@golang golang locked and limited conversation to collaborators Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

5 participants