janhoy opened a new pull request, #4497: URL: https://github.com/apache/solr/pull/4497
Turns out that `DistributedCombinedQueryComponentTest` not only has JSON syntax errors as called out in https://github.com/apache/solr/pull/4495/changes/BASE..3bd0ca661ddc1d72e379e38d0268ec0cd2a55056, but turns out that test totally hangs for hours when run with `-Dtests.nightly=true`, i.e. the jenkins job at https://ci-builds.apache.org/job/Solr/job/Solr-NightlyTests-main/1815/#showFailuresLink This PR is to fix the clear bugs in the test, i.e. the JSON errors and make it no hang in nightly. ## Why did the nightly test fail? `DistributedCombinedQueryComponentTest` was hanging indefinitely during nightly Jenkins runs (hitting the 2-hour timeout every time) due to an infinite loop in the test framework's shard-repeat machinery. In nightly mode, `BaseDistributedSearchTestCase` skips its usual `fixShardCount(2)` call and instead uses a `ShardsRepeatRule` that loops over shard counts 1→2→3 by incrementing an instance field: `for (shardCount = min; shardCount <= max; shardCount++)`. The bug was that `prepareIndexDocs()` — called at the start of every test method — itself called `fixShardCount(2)`, which writes back into that same `shardCount` instance field. This meant that on the `shardCount=1` iteration, the test body reset `shardCount` to 2; the loop's `shardCount++` then made it 3; the condition `3 <= 3` was true, the test ran again, reset `shardCount` to 2 again, incremented to 3 again, and so on forever. The fix removes `fixShardCount(2)` from the test body and instead annotates every test method with `@ShardsFixed(num=2)`, which is the correct mechanism for declaring a fixed shard count: it is evaluated by the rule *before* servers are created, never interferes with the loop counter, and clearly documents that these tests are designed for a 2-shard topology. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
