[improve][test] Add randomized TripleLongPriorityQueue correctness test#26022
Open
void-ptr974 wants to merge 1 commit into
Open
[improve][test] Add randomized TripleLongPriorityQueue correctness test#26022void-ptr974 wants to merge 1 commit into
void-ptr974 wants to merge 1 commit into
Conversation
8573556 to
7eba30c
Compare
merlimat
approved these changes
Jun 14, 2026
lhotari
requested changes
Jun 15, 2026
lhotari
left a comment
Member
There was a problem hiding this comment.
Related to #26028 (review), once we restore fastutil, we can rely on that implementation which has been battle tested over the years.
Member
|
PR to restore fastutil is #26032 |
Member
|
@void-ptr974 #26032 has been merged. Please rebase. I guess tests for removed classes are now unnecessary, but this PR does contain tests for classes that remain so it will be useful. |
7eba30c to
071b358
Compare
Contributor
Author
|
Thanks for the heads-up. I removed the tests for the classes that no longer exist, so this PR now just adds the randomized coverage for |
lhotari
reviewed
Jun 17, 2026
| long seed = configuredSeed != null ? Long.parseLong(configuredSeed) : ThreadLocalRandom.current().nextLong(); | ||
| String message = TripleLongPriorityQueueTest.class.getSimpleName() + "." + testName + " seed=" + seed; | ||
| Reporter.log(message, true); | ||
| System.err.println(message); |
Contributor
Author
There was a problem hiding this comment.
Thanks, removed the System.err logging.
071b358 to
bebd0eb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
TripleLongPriorityQueuerelies on heap ordering across threelongfields. The existing tests cover basic ordering cases, and this adds broader randomized coverage with a reproducible seed for interleaved add/pop sequences.Modifications
PriorityQueueoracle.Long.MIN_VALUEandLong.MAX_VALUE.-Dpulsar.collections.randomSeed=<seed>.Verification
./gradlew :pulsar-common:test --tests org.apache.pulsar.common.util.collections.TripleLongPriorityQueueTest -PtestRetryCount=0 -Dpulsar.collections.randomSeed=123456789./gradlew :pulsar-common:checkstyleTest