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

Fix isTraceStack on newer Go versions #68

Merged
merged 1 commit into from
Sep 27, 2021

Conversation

sywhang
Copy link
Contributor

@sywhang sywhang commented Sep 27, 2021

This fixes #66 .

On newer Go versions (1.16 onwards), the top of trace stacks is no longer runtime.goparkunlock. We had a logic that relied on this being the case, which made the tests to fail with -trace flag for newer Go versions. However, to maintain backwards compatibility, we shouldn't just remove this check.

This separates out the isTraceStack into a separate file that gets conditionally compiled on different Go versions (tracestack_old.go for Go 1.15 and before and tracestack_new.go for Go 1.16 and newer) to address this issue.

Internal Ref: GO-887.

@codecov
Copy link

codecov bot commented Sep 27, 2021

Codecov Report

Merging #68 (5dbd86f) into master (1e9de54) will increase coverage by 0.05%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #68      +/-   ##
==========================================
+ Coverage   93.27%   93.33%   +0.05%     
==========================================
  Files           4        6       +2     
  Lines         119      120       +1     
==========================================
+ Hits          111      112       +1     
  Misses          5        5              
  Partials        3        3              
Impacted Files Coverage Δ
options.go 100.00% <ø> (+2.12%) ⬆️
tracestack_old.go 66.66% <66.66%> (ø)
tracestack_new.go 100.00% <100.00%> (ø)

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 0a774d4...5dbd86f. Read the comment docs.

@sywhang sywhang merged commit 04ba342 into uber-go:master Sep 27, 2021
@sywhang sywhang deleted the fix-tracestack branch September 27, 2021 23:27
sywhang added a commit that referenced this pull request Oct 4, 2021
Preparing for releasing v1.1.12 with fixes from #68.
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.

Running tests with -trace is failing for new versions of go
2 participants