Repository navigation
Conversation
A retry would consume the next scripted answer as the port. Also assert the tool's exit code in testSolrCloudExampleWithScriptInputs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
epugh
approved these changes
Nov 1, 2026
| Locale.ROOT, "Please enter the port for node%d [%d]: ", (n + 1), cloudPorts[n]); | ||
| int port = promptForPort(readInput, n + 1, promptMsg, cloudPorts[n]); | ||
| while (!isPortAvailable(port)) { | ||
| if (usingScriptInputs) { |
Contributor
There was a problem hiding this comment.
That's gnarly bug. Though the fix is good, both for making CI easier but also locally. I've been bit by running a script not realizing I had a zombied solr on port 8984 or was already running it in docker on 8983... and then getting my scripted run blows up obsucrely...
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.
🤖
TestSolrCLIRunExample.testSolrCloudExampleWithScriptInputsfailed on a busy CI worker with a misleading "collection not found" error, and the cause was in the tool, not only the test.Failure chain
ServerSocket(0).RunExampleToolprobes it, another process takes that port. This is a race that only shows on a busy machine, such as a 96-core CI worker.--script-inputsis a fixed ordered list, so the retry consumes the next scripted answers (the collection name, thennumShards) as ports.isPortAvailable(2)hits the test security policy'sSocketPermissiondenial, the tool aborts with exit 1, and Solr never starts.Changes
RunExampleTool: with--script-inputs, a port that is already in use now throws immediately with a clear message. A retry can't recover, since it would read the next scripted value.TestSolrCLIRunExample:testSolrCloudExampleWithScriptInputsasserts the tool's exit code, so a failure shows the tool's error. A newtestScriptInputsPortInUseholds a port open and expects exit code 1.Not changed
The test still picks a port, releases it, and uses it later, so it can still lose that race. It now fails with a clear message. The
failExecuteScriptaccess-denied output in the same log comes from the unrelatedtestFailExecuteScript, which expects it.Testing
gradlew :solr:core:test --tests "org.apache.solr.cli.TestSolrCLIRunExample"passes (7 tests).Related
RunExampleTooland the test into sub-packages) and SOLR-18521: Unify picocli connection options into one ConnectionOptions mixin #5063 (touchesRunExampleTool) overlap these files, so whichever merges second needs a rebase.🤖 Generated with Claude Code