You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2017/10/08 19:38:12 UTC

[02/10] flink git commit: [FLINK-7772][blob] fix test instability in BlobCacheDeleteTest

[FLINK-7772][blob] fix test instability in BlobCacheDeleteTest

BlobCacheDeleteTest did not account for the server executing the delete call of
a transient BLOB after acknowledging the request. This resulted in the
testDeleteTransientLocalFails* tests failing.

This closes #4782


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/a8443a52
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/a8443a52
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/a8443a52

Branch: refs/heads/master
Commit: a8443a52e33e5cf1f85b3be7689292cf52465e40
Parents: d3e15fd
Author: Nico Kruber <ni...@data-artisans.com>
Authored: Fri Oct 6 12:34:40 2017 +0200
Committer: Stephan Ewen <se...@apache.org>
Committed: Fri Oct 6 20:12:51 2017 +0200

----------------------------------------------------------------------
 .../apache/flink/runtime/blob/BlobCacheDeleteTest.java | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/a8443a52/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java
index 8ea2a5e..a83d100 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java
@@ -45,6 +45,7 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+import static org.apache.flink.runtime.blob.BlobCachePutTest.verifyDeletedEventually;
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB;
 import static org.apache.flink.runtime.blob.BlobServerDeleteTest.delete;
 import static org.apache.flink.runtime.blob.BlobServerGetTest.verifyDeleted;
@@ -208,12 +209,12 @@ public class BlobCacheDeleteTest extends TestLogger {
 	}
 
 	@Test
-	public void testDeleteTransientLocalFailsNoJob() throws IOException {
+	public void testDeleteTransientLocalFailsNoJob() throws IOException, InterruptedException {
 		testDeleteTransientLocalFails(null);
 	}
 
 	@Test
-	public void testDeleteTransientLocalFailsForJob() throws IOException {
+	public void testDeleteTransientLocalFailsForJob() throws IOException, InterruptedException {
 		testDeleteTransientLocalFails(new JobID());
 	}
 
@@ -225,7 +226,8 @@ public class BlobCacheDeleteTest extends TestLogger {
 	 * @param jobId
 	 * 		job id
 	 */
-	private void testDeleteTransientLocalFails(@Nullable final JobID jobId) throws IOException {
+	private void testDeleteTransientLocalFails(@Nullable final JobID jobId)
+		throws IOException, InterruptedException {
 		assumeTrue(!OperatingSystem.isWindows()); //setWritable doesn't work on Windows.
 
 		final Configuration config = new Configuration();
@@ -259,10 +261,11 @@ public class BlobCacheDeleteTest extends TestLogger {
 
 				// issue a DELETE request
 				assertFalse(delete(cache, jobId, key));
-				verifyDeleted(server, jobId, key);
 
-				// the file should still be there on both cache and server
+				// the file should still be there on the cache
 				verifyContents(cache, jobId, key, data);
+				// the server should have started the delete call after the cache accessed the (transient!) BLOB
+				verifyDeletedEventually(server, jobId, key);
 			} finally {
 				if (blobFile != null && directory != null) {
 					//noinspection ResultOfMethodCallIgnored