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 2022/05/09 20:14:16 UTC
[GitHub] [kafka] hachikuji commented on a diff in pull request #12142: MINOR: install Exit.exit handler in BrokerMetadataPublisherTest
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org