hachikuji commented on code in PR #12142:
URL: https://github.com/apache/kafka/pull/12142#discussion_r868409011


##########
core/src/test/scala/unit/kafka/server/metadata/BrokerMetadataPublisherTest.scala:
##########
@@ -44,6 +45,22 @@ import org.mockito.stubbing.Answer
 import scala.jdk.CollectionConverters._
 
 class BrokerMetadataPublisherTest {
+  val exitException = new AtomicReference[Throwable](null)
+
+  @BeforeEach
+  def setUp(): Unit = {
+    Exit.setExitProcedure((code, _) => exitException.set(new 
RuntimeException(s"Exit ${code}")))
+    Exit.setHaltProcedure((code, _) => exitException.set(new 
RuntimeException(s"Halt ${code}")))
+  }
+
+  @AfterEach
+  def tearDown(): Unit = {

Review Comment:
   Should we call `Exit.resetExitProcedure` and `Exit.resetHaltProcedure` here?



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to