-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 flakyness by replacing HashSet and HashMap with LinkedHashSet and LinkedHashMap #11941
fix flakyness by replacing HashSet and HashMap with LinkedHashSet and LinkedHashMap #11941
Conversation
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.
We should not change ProjectPlanNode
or AggregationFunctionUtils
because it involves performance overhead to the production code. Can you try handling the order issue within the test?
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.
+1 on @Jackie-Jiang 's comment. best solution is to use a parsed out explanation on project node and do a lexi-sorting on the test side on both the expected and actual value
Sure, let me try to do that. However, how can I handle the case which there could be random order for the nested sqls like line 1447 in ExplainPlanQueriesTest.java |
I can see a simpler way is to create a |
I try the way that Jackie Jiang proposed to use I check the way that walteraddr proposed, it seems like it needs to change the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #11941 +/- ##
============================================
+ Coverage 61.41% 61.62% +0.21%
- Complexity 207 1150 +943
============================================
Files 2378 2385 +7
Lines 128865 129275 +410
Branches 19927 20016 +89
============================================
+ Hits 79143 79671 +528
+ Misses 44001 43808 -193
- Partials 5721 5796 +75
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I took a look at the failed test and don't have too much clue on how to solve that. Can I get a hint? |
I guess we need to modify the test to not test on the string value. @walterddr any suggestion? |
i would suggest instead of using |
@walterddr Do you mean that I can create a different |
correct. explain query itself is not technically a "query" thus the response doesn't necessarily need to be interpretd/validated via the same method. see https://www.postgresql.org/docs/current/using-explain.html#USING-EXPLAIN:
we don't support
|
IMO at this stage we can
|
Got it, let me try doing it. |
Also I am aware of the code coverage change of my change. Can I ask the tool we are using to detect code coverage here? so I can validate the coverage myself before updating the change |
Thank you for considering the test validity and coverage! this is superb! |
I tried to change the |
I found that a part of the non-determinism of For this part, I think the solution would be sorting the However this is not the only cause of the non-deternism of the |
i think we can separate the 2 issues, IIUC the project ordering issue is independent from the numSegmentsForThisPlan
hence my suggestion is we address the PROJECT ordering issue first in this PR and address the plan issue separately CC @somandal who improved upon this part of the logic to chime in :-) |
Roger that Here is the solution I suggest In
In If apply this fix, instead of fixing all
If you guys think this fix is good, I will push the new commit. |
As Stated in the issue/11939