Github user uce commented on a diff in the pull request:
https://github.com/apache/incubator-flink/pull/211#discussion_r20497561
--- Diff:
flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/BlobLibraryCacheManagerTest.java
---
@@ -73,7 +73,19 @@ public void testLibraryCacheManagerCleanup(){
libraryCacheManager.unregisterJob(jid);
- Thread.sleep(1500);
+ // because we cannot guarantee that there are not
thread races in the build system, we
+ // loop for a certain while until the references
disappear
+ {
+ long deadline = System.currentTimeMillis() +
30000;
+ do {
+ Thread.sleep(500);
+ }
+ while
(libraryCacheManager.getNumberOfCachedLibraries() > 0 &&
+ System.currentTimeMillis() <
deadline);
+ }
+
+ // this fails if we exited via a timeout
+ assertEquals(0,
libraryCacheManager.getNumberOfCachedLibraries());
--- End diff --
minor: I would add an error message, so we don't panic when this test fails
and have an idea of what happened ;)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---