Skip to content

fix: synchronize test logs to prevent t.Log race condition #146

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

Merged
merged 4 commits into from
May 25, 2022

Conversation

coadler
Copy link
Contributor

@coadler coadler commented May 25, 2022

If (*testing.T).Log is called concurrently of a test exiting, it's
picked up by the race detector. This adds logic to allow slogtest to
detect when a test has exited, and ensure it doesn't call
(*testing.T).Log after that happens.

If `(*testing.T).Log` is called concurrently of a test exiting, it's
picked up by the race detector. This adds logic to allow slogtest to
detect when a test has exited, and ensure it doesn't call
`(*testing.T).Log` after that happens.
@coadler coadler requested review from dwahler and kylecarbs May 25, 2022 19:42
@coadler coadler self-assigned this May 25, 2022
@coveralls
Copy link

coveralls commented May 25, 2022

Pull Request Test Coverage Report for Build a64d7100c48aad81449acb051c4d324c4c2336c5-PR-

  • 19 of 19 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 97.541%

Files with Coverage Reduction New Missed Lines %
sloggers/slogtest/t.go 2 96.67%
Totals Coverage Status
Change from base Build 047b2a21fd5366e616609840b26761300b8d84c5: -0.2%
Covered Lines: 714
Relevant Lines: 732

💛 - Coveralls

Copy link

@dwahler dwahler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@coadler coadler merged commit 18dce5c into main May 25, 2022
@coadler coadler deleted the colin/sync-test-logs branch May 25, 2022 20:01
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.

3 participants