tombentley opened a new pull request #9822:
URL: https://github.com/apache/kafka/pull/9822


   Fixes [KAFKA-10860](https://issues.apache.org/jira/browse/KAFKA-10860) and 
adds a unit test.
   
   The existing code was not easily testable, so refactored to allow the main 
logic to be executed without invoking `System.exit` or equivalent. The tests 
added here cover most of the non-connection options, but have to use 
`--one-time`. I just use the current JVM's MBean server for these tests. 
Testing the connection code would require spinning up a JVM to connect to, or 
using the Attach API (which is prevented by 
https://bugs.openjdk.java.net/browse/JDK-8180425).
   
   Although `--wait` was described as not supported in the presence of a 
pattern but this wasn't validated previously. Supporting that actually makes 
the code simpler by avoiding the need to special-case the presence of a 
pattern. The semantics are that we wait until each of the given patterns 
selects at least one `ObjectName`, which is consistent with the behaviour for a 
non-patterned `--wait`.


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to