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: Add cleanup for Trace context #266

Merged
merged 3 commits into from Dec 10, 2020
Merged

Conversation

simonz130
Copy link

Added cleanup of trace context before each test execution of tests that set it. This prevents side effects for other tests as a result of random ordering in junit.

Fixes #265 ☕️
Fixes #264 ☕️
Fixes #263 ☕️

simonz130 added 2 commits December 10, 2020 10:46
Previously we didn't cleanup trace context so it could cause side effects to some tests as a result of added label in trace context tests. To mitigate this, we added a method to cleanup trace context from MDC as well as invoke it before every test
Previously we didn't cleanup trace context so it could cause side effects to some tests as a result of added label in trace context tests. To mitigate this, we added a method to cleanup trace context from MDC as well as invoke it before every test
@simonz130 simonz130 added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. api: logging Issues related to the googleapis/java-logging-logback API. labels Dec 10, 2020
@simonz130 simonz130 self-assigned this Dec 10, 2020
@simonz130 simonz130 requested a review from a team as a code owner December 10, 2020 18:54
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Dec 10, 2020
@codecov
Copy link

codecov bot commented Dec 10, 2020

Codecov Report

Merging #266 (1c83b6a) into master (e7753e6) will increase coverage by 0.40%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #266      +/-   ##
============================================
+ Coverage     68.62%   69.03%   +0.40%     
- Complexity       39       40       +1     
============================================
  Files             3        3              
  Lines           153      155       +2     
  Branches         17       17              
============================================
+ Hits            105      107       +2     
  Misses           33       33              
  Partials         15       15              
Impacted Files Coverage Δ Complexity Δ
...oud/logging/logback/TraceLoggingEventEnhancer.java 81.81% <100.00%> (+4.04%) 5.00 <1.00> (+1.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 e7753e6...1c83b6a. Read the comment docs.

Copy link
Contributor

@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

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

LGTM, but please run mvn com.coveo:fmt-maven-plugin:format to fix the lint.

The bot is behaving weirdly for suggesting the formatting fixes.

@simonz130 simonz130 added the automerge Merge the pull request once unit tests and other checks pass. label Dec 10, 2020
@simonz130 simonz130 merged commit af43dfa into master Dec 10, 2020
@simonz130 simonz130 deleted the fixTracecontextCleanup branch December 10, 2020 19:20
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/java-logging-logback API. cla: yes This human has signed the Contributor License Agreement. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
4 participants