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

Ignore blocked trace stack by default #40

Merged
merged 1 commit into from
Jan 7, 2020
Merged

Ignore blocked trace stack by default #40

merged 1 commit into from
Jan 7, 2020

Conversation

prashantv
Copy link
Collaborator

When running tests with -trace, a background
goroutine blocks on runtime.ReadTrace:

Goroutine 20 in state trace reader (blocked), with runtime.goparkunlock on top of the stack:
goroutine 20 [trace reader (blocked)]:
runtime.goparkunlock(...)
	(truncated)/go1.13.linux.amd64/src/runtime/proc.go:310
runtime.ReadTrace(0xc00008e048, 0xc0000160d0, 0x10)
	(truncated)/go1.13.linux.amd64/src/runtime/trace.go:395 +0x4ed
runtime/trace.Start.func1(0x7b3dc0, 0xc00008e048)
	(truncated)/go1.13.linux.amd64/src/runtime/trace/trace.go:129 +0x47
created by runtime/trace.Start
	(truncated)/go1.13.linux.amd64/src/runtime/trace/trace.go:127 +0xd8

Skip this stack by default. Run tests with -trace enabled to verify
that this stack should be skipped.

Fixes #39.

When running tests with `-trace`, a background
goroutine blocks on `runtime.ReadTrace`:
```
Goroutine 20 in state trace reader (blocked), with runtime.goparkunlock on top of the stack:
goroutine 20 [trace reader (blocked)]:
runtime.goparkunlock(...)
	(truncated)/go1.13.linux.amd64/src/runtime/proc.go:310
runtime.ReadTrace(0xc00008e048, 0xc0000160d0, 0x10)
	(truncated)/go1.13.linux.amd64/src/runtime/trace.go:395 +0x4ed
runtime/trace.Start.func1(0x7b3dc0, 0xc00008e048)
	(truncated)/go1.13.linux.amd64/src/runtime/trace/trace.go:129 +0x47
created by runtime/trace.Start
	(truncated)/go1.13.linux.amd64/src/runtime/trace/trace.go:127 +0xd8
```

Skip this stack by default. Run tests with `-trace` enabled to verify
that this stack should be skipped.

Fixes #39.
@codecov
Copy link

codecov bot commented Dec 20, 2019

Codecov Report

Merging #40 into master will increase coverage by 0.17%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #40      +/-   ##
=========================================
+ Coverage   95.03%   95.2%   +0.17%     
=========================================
  Files           4       4              
  Lines         141     146       +5     
=========================================
+ Hits          134     139       +5     
  Misses          4       4              
  Partials        3       3
Impacted Files Coverage Δ
options.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7380c5a...5735272. Read the comment docs.

@prashantv
Copy link
Collaborator Author

Capturing an offline discussion with @abhinav:

This is non-ideal, since it's just a string match against the entire stack, which is more likely to have false positives. As a follow up, filed #41 to parse the stack for better matching, but want to release this fix soon.

@prashantv prashantv merged commit 7b53663 into master Jan 7, 2020
@prashantv prashantv deleted the ignore_trace branch January 7, 2020 19:44
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.

False positive with go test -trace=test.out
2 participants