zhuzhurk commented on a change in pull request #12181: URL: https://github.com/apache/flink/pull/12181#discussion_r427794339
########## File path: flink-core/src/test/java/org/apache/flink/core/fs/SafetyNetCloseableRegistryTest.java ########## @@ -198,4 +198,29 @@ public void testReaperThreadSpawnAndStop() throws Exception { } Assert.assertFalse(SafetyNetCloseableRegistry.isReaperThreadRunning()); } + + /** + * Test whether failure to start thread in {@link SafetyNetCloseableRegistry} + * constructor can lead to failure of subsequent state check. + */ + @Test + public void testReaperThreadStartFailed() throws Exception { + + try { + new SafetyNetCloseableRegistry(() -> new OutOfMemoryReaperThread()); + } catch (java.lang.OutOfMemoryError error) { + } + Review comment: We can add `isReaperThreadRunning` checks after the failed creation and the succeeded creation. This helps to verify that a reaper thread is really created and running. ---------------------------------------------------------------- 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