JingsongLi commented on a change in pull request #17655: URL: https://github.com/apache/flink/pull/17655#discussion_r749933893
########## File path: flink-core/src/test/java/org/apache/flink/testutils/TestFileSystem.java ########## @@ -37,28 +43,45 @@ public static final String SCHEME = "test"; - private static int streamOpenCounter; + // number of (input) stream opened + private static final AtomicInteger streamOpenCounter = new AtomicInteger(0); + + // current number of created, unclosed (output) stream + private static final Map<Path, Integer> currentUnclosedOutputStream = new ConcurrentHashMap<>(); public static int getNumtimeStreamOpened() { - return streamOpenCounter; + return streamOpenCounter.get(); + } + + public static Map<Path, Integer> getCurrentUnclosedOutputStream() { + return currentUnclosedOutputStream; } - public static void resetStreamOpenCounter() { - streamOpenCounter = 0; + public static void resetStreamCounter() { Review comment: Can we just `reset(Path)`? I think maybe there are some unstable cases if just clear all counters. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org