-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-25542][Core][Test] Move flaky test in OpenHashMapSuite to OpenHashSetSuite and make it against OpenHashSet #22569
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
Conversation
|
LGTM |
|
Test build #96688 has finished for PR 22569 at commit
|
|
retest this please. |
| val pos1 = set.addWithoutResize(i) & OpenHashSet.POSITION_MASK | ||
| val pos2 = set.getPos(i) | ||
| assert(pos1 == pos2) | ||
| } |
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.
nit: Is it better to add the following to check each value after adding all, too?
for (i <- 0 until cnt) {
assert(set.contains(i))
}
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.
If we want to add the check, we can also add it inside the loop. Another loop seems unnecessary to me.
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.
My intention was to verify whether small values (e.g. 0, 1, 2, 3) are still valid after several resizings.
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.
I see. I think that is not what this wants test and there are other tests to make sure it works. If you insist I can add it too.
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.
The original test performed a check by using map.iterator.count(). But, this is not a strong preference.
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.
oh, the original test performed the count check to see how many values are invalid. They are invalid values because the index is wrong due to wrong position mask in OpenHashSet.
This rewritten test tests directly the index of OpenHashSet.
|
LGTM except one minor comment |
| assert(set.contains(i)) | ||
|
|
||
| val pos1 = set.addWithoutResize(i) & OpenHashSet.POSITION_MASK | ||
| val pos2 = set.getPos(i) |
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.
Thank you for doing this, @viirya .
Shall we switch the line 267 and 266 because set.addWithoutResize(i) has side-effects like changing the underlying structure. Although the situation will not happen because we called addWithoutResize inside add at line 263. But, we had better get the comparison target value from the read-only function first.
|
Also, please fix the tag in the PR title from |
|
Test build #96697 has finished for PR 22569 at commit
|
|
Test build #96701 has finished for PR 22569 at commit
|
|
Test build #96726 has finished for PR 22569 at commit
|
|
retest this please. |
|
Test build #96733 has finished for PR 22569 at commit
|
|
retest this please. |
|
Test build #96738 has finished for PR 22569 at commit
|
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, LGTM. Thank you again.
|
Merged to master/branch-2.4. |
…HashSetSuite and make it against OpenHashSet ## What changes were proposed in this pull request? The specified test in OpenHashMapSuite to test large items is somehow flaky to throw OOM. By considering the original work #6763 that added this test, the test can be against OpenHashSetSuite. And by doing this should be to save memory because OpenHashMap allocates two more arrays when growing the map/set. ## How was this patch tested? Existing tests. Closes #22569 from viirya/SPARK-25542. Authored-by: Liang-Chi Hsieh <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit b7d8034) Signed-off-by: Dongjoon Hyun <[email protected]>
…HashSetSuite and make it against OpenHashSet ## What changes were proposed in this pull request? The specified test in OpenHashMapSuite to test large items is somehow flaky to throw OOM. By considering the original work apache#6763 that added this test, the test can be against OpenHashSetSuite. And by doing this should be to save memory because OpenHashMap allocates two more arrays when growing the map/set. ## How was this patch tested? Existing tests. Closes apache#22569 from viirya/SPARK-25542. Authored-by: Liang-Chi Hsieh <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
…HashSetSuite and make it against OpenHashSet ## What changes were proposed in this pull request? The specified test in OpenHashMapSuite to test large items is somehow flaky to throw OOM. By considering the original work apache#6763 that added this test, the test can be against OpenHashSetSuite. And by doing this should be to save memory because OpenHashMap allocates two more arrays when growing the map/set. ## How was this patch tested? Existing tests. Closes apache#22569 from viirya/SPARK-25542. Authored-by: Liang-Chi Hsieh <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
What changes were proposed in this pull request?
The specified test in OpenHashMapSuite to test large items is somehow flaky to throw OOM.
By considering the original work #6763 that added this test, the test can be against OpenHashSetSuite. And by doing this should be to save memory because OpenHashMap allocates two more arrays when growing the map/set.
How was this patch tested?
Existing tests.