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

[django] Fix django test flake #446

Merged
merged 1 commit into from
Mar 30, 2018
Merged

Conversation

willgittoes-dd
Copy link
Contributor

I do this by ensuring that only one of MIDDLEWARE and MIDDLEWARE_CLASSES gets patched.

Downside: I still don't completely understand why it would flake, I know there is some kind of race in the tests happening where the insert_trace_middleware function gets called multiple times but I couldn't figure out what it is. I was starting to spend a little too much time on this, so I figured you'd at least enjoy a solution.

I just made sure that insert_trace_middleware is idempotent now.

@willgittoes-dd
Copy link
Contributor Author

I verified this fix works by re-running CI until I found one that broke, SSHing in, verifying that the tests continue to fail, applying this fix, then verifying that the tests are passing (and that they break again when fix is unpatched).

Copy link
Contributor

@bmermet bmermet left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks for fixing that bug 👍

@palazzem palazzem added this to the 0.11.1 milestone Mar 29, 2018
Copy link

@palazzem palazzem left a comment

Choose a reason for hiding this comment

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

Thank you very much! that way we properly add the value in the right setting, fixing also a (possible) race condition in our test suite.

@palazzem palazzem merged commit a88810a into master Mar 30, 2018
@palazzem palazzem deleted the willgittoes-dd/duplicate-middleware branch March 30, 2018 09:02
apoorv007 pushed a commit to archsaber/dd-trace-py that referenced this pull request Apr 3, 2018
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.

None yet

3 participants