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 leaky configuration failure in integration test #1417

Merged
merged 1 commit into from
Mar 18, 2021
Merged

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Mar 18, 2021

Since #1334 was merged, we noticed flaky tests affecting the master branch.

This PR unblocks the master branch build.

This happens because we don't have a clean Datadog.configuration object for each test run.

For this specific case, we want a clean tracer instance for this test, but this value is normally populated from previous runs. Because Datadog.configuration has not deep reset feature, we always try to reset parts of it during tests, but we can forget those.

As a follow up, we should always correctly reset the components and configuration between each test run.

@marcotc marcotc added the dev/testing Involves testing processes (e.g. RSpec) label Mar 18, 2021
@marcotc marcotc requested a review from a team March 18, 2021 20:51
@marcotc marcotc self-assigned this Mar 18, 2021
@marcotc
Copy link
Member Author

marcotc commented Mar 18, 2021

Given CI is green, I'm merging this PR now in order to unblock all ddtrace developers.

@marcotc marcotc merged commit d7a87e1 into master Mar 18, 2021
@marcotc marcotc deleted the fix-master-flaky branch March 18, 2021 20:53
@github-actions github-actions bot added this to the 0.47.0 milestone Mar 18, 2021
Comment on lines -9 to +15
Datadog.configure {}
# TODO: We manually unset the tracer instance here as
# we don't have a mechanism to deeply reset the
# `Datadog.configuration` object.

# Ensure we terminate the existing tracer instance, if any
Datadog.configuration.tracer.instance.shutdown! if Datadog.configuration.tracer.instance
Datadog.configure { |c| c.tracer.instance = nil }
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if Datadog.reset! would be a better fit here?

@marcotc
Copy link
Member Author

marcotc commented Mar 19, 2021 via email

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.

None yet

2 participants