question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TestDocumentsWriterStallControl takes over a minute with -Ptests.seed=B83F4990EF501F47

See original GitHub issue

Description

gradlew test -p lucene/core --tests *TestDocumentsWriterStallControl* -Ptests.seed=B83F4990EF501F47

I noticed this while running unrelated tests but it does reproduce. Could be an unfortunate randomization pattern but it takes an awful long time to finish (and CPU usage is nearly nothing in between). Weird.

Version and environment details

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rmuircommented, Oct 31, 2022

It runs much faster with this patch:

--- a/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java
@@ -62,7 +62,7 @@ public class TestDocumentsWriterStallControl extends LuceneTestCase {
             @Override
             public void run() {

-              int iters = atLeast(1000);
+              int iters = atLeast(100);
               for (int j = 0; j < iters; j++) {
                 ctrl.updateStalled(random().nextInt(stallProbability) == 0);
                 if (random().nextInt(5) == 0) { // thread 0 only updates
0reactions
rmuircommented, Oct 31, 2022

The condition where this test takes minutes isn’t that rare, I ran the test 10 times and hit the slow condition 3 out of 10 executions:

  • 151s
  • 158s
  • 32s

With the patch, I ran the test 50 times and it was always reasonable. Will make a PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found