[ https://issues.apache.org/jira/browse/FLINK-18815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17190870#comment-17190870 ]
Kezhu Wang commented on FLINK-18815: ------------------------------------ [~trohrmann] Your are right, I made mistake. After revise, I found {{AbstractCloseableRegistryTest.testClose}} itself is faulty for {{SafetyNetCloseableRegistry}}. The failed assertion could happens before {{innerCloseable.close}}. This could be easily verified by place endless loop before {{innerCloseable.close}}. I think we can fix this with following changes: 1. Join {{CloseableReaperThread}} before assertion for {{SafetyNetCloseableRegistryTest}}. This should fix recently failed cases. 2. Replace {{CloseableReaperThread.interrupt}} with {{CloseableReaperThread.stop}}, eg. set {{CloseableReaperThread.running}} to false without interrupting {{CloseableReaperThread}}. Replace {{CloseableReaperThread.referenceQueue.remove()}} with {{CloseableReaperThread.referenceQueue.remove(long timeout)}}. This prevent blocking {{Closeable.close}} from interruption, though I think it is not a must since {{Closeable.close}} are not allowed to throw {{InterruptedException}} in spec. It is a friendly improvement for registered {{Closeable}}. > AbstractCloseableRegistryTest.testClose unstable > ------------------------------------------------ > > Key: FLINK-18815 > URL: https://issues.apache.org/jira/browse/FLINK-18815 > Project: Flink > Issue Type: Bug > Components: FileSystems, Tests > Affects Versions: 1.10.1, 1.12.0, 1.11.1 > Reporter: Robert Metzger > Assignee: Kezhu Wang > Priority: Critical > Labels: pull-request-available, test-stability > Fix For: 1.10.2, 1.12.0, 1.11.2 > > > https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=5164&view=logs&j=0da23115-68bb-5dcd-192c-bd4c8adebde1&t=05b74a19-4ee4-5036-c46f-ada307df6cf0 > {code} > [ERROR] Tests run: 6, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.509 > s <<< FAILURE! - in org.apache.flink.core.fs.SafetyNetCloseableRegistryTest > [ERROR] testClose(org.apache.flink.core.fs.SafetyNetCloseableRegistryTest) > Time elapsed: 1.15 s <<< FAILURE! > java.lang.AssertionError: expected:<0> but was:<-1> > at org.junit.Assert.fail(Assert.java:88) > at org.junit.Assert.failNotEquals(Assert.java:834) > at org.junit.Assert.assertEquals(Assert.java:645) > at org.junit.Assert.assertEquals(Assert.java:631) > at > org.apache.flink.core.fs.AbstractCloseableRegistryTest.testClose(AbstractCloseableRegistryTest.java:93) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)