You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/11/05 22:17:29 UTC

[GitHub] [kafka] jsancio commented on a change in pull request #11457: MINOR: guard against calls to exit in QuorumTestHarness tests

jsancio commented on a change in pull request #11457:
URL: https://github.com/apache/kafka/pull/11457#discussion_r744002667



##########
File path: core/src/test/scala/integration/kafka/server/QuorumTestHarness.scala
##########
@@ -163,6 +163,14 @@ abstract class QuorumTestHarness extends Logging {
   // That way you control the initialization order.
   @BeforeEach
   def setUp(testInfo: TestInfo): Unit = {
+    Exit.setExitProcedure((code, message) => {
+      error(s"exit(${code}, ${message}) called!")
+      tearDown()
+    })
+    Exit.setHaltProcedure((code, message) => {
+      error(s"halt(${code}, ${message}) called!")
+      tearDown()

Review comment:
       I think this implementation for `setExitProcedure` and `setHaltProcedure` would allow the test that called `Exit.exit` and `Exit.halt` to continue. This is probably not what the user intended when they call those methods. If you agree, how about throwing an unchecked exception. Maybe `AssertionError`




-- 
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: jira-unsubscribe@kafka.apache.org

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