From fb32ff1aed2707cdc17bc3e422aa4590b8599a56 Mon Sep 17 00:00:00 2001 From: Nico Kruber Date: Mon, 21 Aug 2017 17:20:30 +0200 Subject: [PATCH 1/2] [FLINK-7487][tests] fix ClassLoaderITCase#testDisposeSavepointWithCustomKvState not self-contained The cancellation of the job started in #testDisposeSavepointWithCustomKvState may actually continue after the test method succeeds and may thus stop further jobs from being executed. This may result in a NoResourceAvailableException. --- .../org/apache/flink/test/classloading/ClassLoaderITCase.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flink-tests/src/test/java/org/apache/flink/test/classloading/ClassLoaderITCase.java b/flink-tests/src/test/java/org/apache/flink/test/classloading/ClassLoaderITCase.java index 98bb0eadd3251..1e43b68e2025b 100644 --- a/flink-tests/src/test/java/org/apache/flink/test/classloading/ClassLoaderITCase.java +++ b/flink-tests/src/test/java/org/apache/flink/test/classloading/ClassLoaderITCase.java @@ -391,5 +391,8 @@ public void run() { Future cancelFuture = jm.ask(new JobManagerMessages.CancelJob(jobId), deadline.timeLeft()); Object response = Await.result(cancelFuture, deadline.timeLeft()); assertTrue("Unexpected response: " + response, response instanceof JobManagerMessages.CancellationSuccess); + + // make sure, the execution is finished to not influence other test methods + invokeThread.join(deadline.timeLeft().toMillis()); } } From f51d61890ef7ad3636857ad21892eec59e8b0685 Mon Sep 17 00:00:00 2001 From: Nico Kruber Date: Thu, 21 Sep 2017 15:06:27 +0200 Subject: [PATCH 2/2] [FLINK-7487][tests] address PR comments --- .../org/apache/flink/test/classloading/ClassLoaderITCase.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flink-tests/src/test/java/org/apache/flink/test/classloading/ClassLoaderITCase.java b/flink-tests/src/test/java/org/apache/flink/test/classloading/ClassLoaderITCase.java index 1e43b68e2025b..a09633d4d62c5 100644 --- a/flink-tests/src/test/java/org/apache/flink/test/classloading/ClassLoaderITCase.java +++ b/flink-tests/src/test/java/org/apache/flink/test/classloading/ClassLoaderITCase.java @@ -69,6 +69,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.isA; import static org.hamcrest.Matchers.hasProperty; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -394,5 +395,6 @@ public void run() { // make sure, the execution is finished to not influence other test methods invokeThread.join(deadline.timeLeft().toMillis()); + assertFalse("Program invoke thread still running", invokeThread.isAlive()); } }