Skip to content

Conversation

Narendra9793
Copy link

This PR addresses the issue where TestTermInSetQuery.testDuel occasionally ran into OutOfMemoryError during randomized stress tests.

🔧 Changes Made:

Updated testDuel to limit the size of randomly generated terms and queries.

Added safeguards to avoid unbounded memory usage during stress test execution.

Ensured the test remains effective in validating correctness while being memory-efficient.

✅ Verification:

Ran affected test multiple times locally to confirm no OutOfMemoryError occurs.

Verified test correctness and consistency across different seeds.

Copy link
Contributor

This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog label to it and you will stop receiving this reminder on future updates to the PR.

Comment on lines +118 to +122
// final int numTerms = TestUtil.nextInt(random(), 1, 1 << TestUtil.nextInt(random(), 1, 10));
final int numTerms = Math.min(
TestUtil.nextInt(random(), 1, 1 << TestUtil.nextInt(random(), 1, 10)),
maxTerms
);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd reuse RandomizedTest.randomIntBetween(...) instead of this code.

Copy link
Contributor

@dweiss dweiss left a comment

Choose a reason for hiding this comment

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

I'd like to see the reason why this test OOMs first - what's causing the memory blowout? Limiting the ranges doesn't seem like a good fix for the underlying problem - you also increase the number of documents in this patch, which is counterintuitive to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants