-
Notifications
You must be signed in to change notification settings - Fork 1k
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 race in execution of tests #6177
Fix race in execution of tests #6177
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6177 +/- ##
=============================================
- Coverage 69.93% 69.90% -0.03%
+ Complexity 17727 17722 -5
=============================================
Files 1996 1998 +2
Lines 75402 75443 +41
Branches 7717 7718 +1
=============================================
+ Hits 52730 52740 +10
- Misses 19995 20024 +29
- Partials 2677 2679 +2 ☔ View full report in Codecov by Sentry. |
…tests. Specifically, an itinerary can be flagged for deletion in one test, which affects the assertions in the next test. Without this, tests may fail if they are executed in a certain order. This may be because LC_COLLATE is not set in the environment.
eac5d35
to
d34f27f
Compare
Updated PR with variable names reflecting that they are no longer static. |
Would you mind changing the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks ok, I would appreciate if you fixed the Itinerary.isFlaggedForDeletion()
in this PR or in a sep PR. But, it is not required to merge the PR .
… Itinerary is flagged for deletion.
48399cc
I've added a one-liner commit that simplifies the |
Summary
Make the test itinerary instance non-static as it's modified in some tests.
Specifically, an itinerary can be flagged for deletion in one test, which affects the assertions in the next test.
Without this, tests may fail if they are executed in a certain order. This may be because LC_COLLATE is not set in the environment.
Similar code
Searching for this idiom in the tree:
...reveals other usages, although that presently they do not cause build problems. But in the worst case, it could be that a test passes because a previously executed test provides the wanted state.
Bonus observation
Itinerary.isFlaggedForDeletion()
callsgetSystemNotices()
which in turn makes a copy of thesystemNotices
collection. This seems wasteful and just generates GC churn.