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

Improve integration testing for dynamic configuration #3012

Merged
merged 2 commits into from
Jul 28, 2023
Merged

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Jul 28, 2023

This PR makes the integration tests for dynamic configuration a bit less noisy and a bit less flaky.

The tests only fail for JRuby 9.2, but the noisy threads is for all versions of Ruby.

@marcotc marcotc requested a review from a team July 28, 2023 20:21
@marcotc marcotc self-assigned this Jul 28, 2023
@github-actions github-actions bot added the dev/testing Involves testing processes (e.g. RSpec) label Jul 28, 2023
after do
# Ensure RC background worker is stopped before we disable webmock
# to avoid failed HTTP requests, trying to make a real remote call.
Datadog.shutdown!
Copy link
Member Author

Choose a reason for hiding this comment

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

This currently generates an error in a background thread, after the test assertions finish, because the RC worker thread tries to make an unmocked RC call after we call WebMock.disable!. This PR ensures the RC worker is closed before WebMock.disable! is called.

after { SemanticLogger.remove_appender(appender) }
after do
SemanticLogger.remove_appender(appender)
SemanticLogger::Logger.processor.thread.kill
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a leaky thread, emitting warnings on test run.

@codecov-commenter
Copy link

Codecov Report

Merging #3012 (6430b54) into master (386d499) will increase coverage by 0.01%.
Report is 40 commits behind head on master.
The diff coverage is 98.98%.

@@            Coverage Diff             @@
##           master    #3012      +/-   ##
==========================================
+ Coverage   98.08%   98.09%   +0.01%     
==========================================
  Files        1316     1317       +1     
  Lines       73819    74281     +462     
  Branches     3385     3387       +2     
==========================================
+ Hits        72403    72865     +462     
  Misses       1416     1416              
Files Changed Coverage Δ
lib/datadog/tracing/configuration/settings.rb 94.92% <ø> (-0.15%) ⬇️
...atadog/tracing/contrib/active_record/events/sql.rb 97.61% <ø> (-0.16%) ⬇️
...ng/contrib/active_support/cache/instrumentation.rb 86.11% <ø> (+0.39%) ⬆️
lib/datadog/tracing/contrib/ethon/multi_patch.rb 97.91% <ø> (-0.09%) ⬇️
lib/datadog/tracing/contrib/grpc/formatting.rb 98.21% <0.00%> (-1.79%) ⬇️
lib/datadog/tracing/contrib/racecar/event.rb 97.43% <ø> (+2.31%) ⬆️
lib/datadog/tracing/metadata/ext.rb 100.00% <ø> (ø)
...pec/datadog/tracing/configuration/settings_spec.rb 100.00% <ø> (ø)
...dog/tracing/contrib/active_record/multi_db_spec.rb 93.60% <ø> (-0.57%) ⬇️
...tadog/tracing/contrib/active_record/tracer_spec.rb 97.59% <ø> (-0.14%) ⬇️
... and 103 more

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@marcotc marcotc merged commit a197a82 into master Jul 28, 2023
162 checks passed
@marcotc marcotc deleted the testing-rc branch July 28, 2023 22:46
@github-actions github-actions bot added this to the 1.13.0 milestone Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/testing Involves testing processes (e.g. RSpec)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants