Github user tzulitai commented on a diff in the pull request:
https://github.com/apache/flink/pull/5193#discussion_r158400189
--- Diff:
flink-streaming-java/src/test/java/org/apache/flink/streaming/util/AbstractStreamOperatorTestHarness.java
---
@@ -492,6 +503,10 @@ public void close() throws Exception {
processingTimeService.shutdownService();
}
setupCalled = false;
+
+ if (internalEnvironment.isPresent()) {
--- End diff --
Or, another option, if we make sure the `MockEnvironment::close()` method
is idempotent, we don't really need to differentiate whether or not the
environment is internally created, and just always close the environment when
closing the test harness.
That could probably make things even more safer?
---