dsmiley commented on PR #4478:
URL: https://github.com/apache/solr/pull/4478#issuecomment-4635139748

   >  ./gradlew :solr:core:test --tests 
"org.apache.solr.cli.PackageToolTest.testDeployValidationMessages" 
"-Ptests.jvmargs=-XX:TieredStopAtLevel=1 -XX:+UseParallelGC 
-XX:ActiveProcessorCount=1 -XX:ReservedCodeCacheSize=120m" 
-Ptests.seed=1857D9F7F40D1569 -Ptests.useSecurityManager=true 
-Ptests.file.encoding=ISO-8859-1
   
   Claude Opus's analysis:
   ----
   The new `testDeployValidationMessages` test is broken. It fails with 
`AssertionError: Should report missing package`.
   
   **Root cause:** `PackageManager.deploy()` outputs the error message via 
`printRed()` → `SolrCLI.print()` → `CLIO.out()`, which writes directly to 
stdout. But the test captures output through `CLITestHelper.TestingRuntime`, 
which only captures calls to its own `print()`/`println()` methods. Since 
`printRed()` bypasses the `TestingRuntime` entirely, 
`captureRuntime.getOutput()` is empty and the assertion at line 405 fails.
   
   Additionally, after `printRed()`, `runtime.exit(1)` throws 
`RuntimeException("exit() not allowed in tests")`, which `ToolBase.runTool()` 
catches and prints to `CLIO.err()` — also not captured by the runtime.
   
   The fix would be to route error output in `PackageManager` through the 
`ToolRuntime` instead of the static `CLIO.out()`.
   


-- 
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]

Reply via email to