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

profiler: fix race in TestProfilerPassthrough #601

Merged
merged 4 commits into from
Mar 2, 2020

Conversation

knusbaum
Copy link
Contributor

@knusbaum knusbaum commented Feb 26, 2020

In CircleCI the TestProfilerPassthrough test seems to be flaky and run into the "time expired" failure frequently.

The test previously was trying to read from the p.out channel, which was racing against the send() function and uploadFunc

This patch makes the test read from the correct out channel and eliminates an unnecessary loop.

@knusbaum knusbaum added this to the 1.23.0 milestone Feb 26, 2020
@knusbaum knusbaum changed the title profiler: improve TestProfilerPassthrough profiler: fix race in TestProfilerPassthrough Feb 26, 2020
The test previously was trying to read from the p.out channel, which was racing against the send() function and uploadFunc

This patch makes the test read from the correct out channel and eliminates an unnecessary loop.
@knusbaum knusbaum force-pushed the knusbaum/improve_profiler_test branch from 9fc8171 to 2ed08f7 Compare February 26, 2020 20:23
@knusbaum knusbaum marked this pull request as ready for review February 26, 2020 20:25
@cgilmour
Copy link
Contributor

This doesn't fix it.
I could still trigger the "time expired" after a few runs of go test -run=TestProfilerPassthrough

@knusbaum
Copy link
Contributor Author

@cgilmour I increased the timeout. Please let me know if you're still seeing failures.

It would be ideal to eliminate the time dependency of this test altogether, but that's a larger change and I don't want to block other PRs on it.

cgilmour
cgilmour previously approved these changes Feb 27, 2020
profiler/profiler_test.go Show resolved Hide resolved
@knusbaum knusbaum merged commit 42b8ae8 into v1 Mar 2, 2020
@gbbr gbbr deleted the knusbaum/improve_profiler_test branch March 10, 2020 10:32
mingrammer pushed a commit to mingrammer/dd-trace-go that referenced this pull request Dec 22, 2020
The test previously was trying to read from the p.out channel, which was racing against the send() function and uploadFunc

This patch makes the test read from the correct out channel and eliminates an unnecessary loop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants