You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ga...@apache.org on 2019/08/05 09:02:22 UTC

[flink] branch master updated (80e81c7 -> 1ad16bc)

This is an automated email from the ASF dual-hosted git repository.

gary pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git.


    from 80e81c7  [FLINK-13463][table-common] Relax legacy type info conversion for VARCHAR literals
     new 0c6fcfa  [hotfix][tests] Remove unused method CommonTestUtils#isProcessAlive(Process)
     new 3d07f5a  [hotfix][tests] Remove unused method CommonTestUtils#sleepUninterruptibly(long)
     new a253fca  [hotfix][tests] Fix typo in method CommonTestUtils#isSteamContentEqual()
     new 1ad16bc  [FLINK-13508][tests] Prevent waitUntilCondition() from sleeping negative time

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../checkpoint/CheckpointCoordinatorTest.java      | 10 ++---
 .../DuplicatingCheckpointOutputStreamTest.java     |  4 +-
 .../flink/runtime/testutils/CommonTestUtils.java   | 48 ++--------------------
 3 files changed, 10 insertions(+), 52 deletions(-)


[flink] 01/04: [hotfix][tests] Remove unused method CommonTestUtils#isProcessAlive(Process)

Posted by ga...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gary pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 0c6fcfa904d80f08d834fad8a055e4a16d236dd8
Author: Gary Yao <ga...@apache.org>
AuthorDate: Wed Jul 31 12:04:30 2019 +0200

    [hotfix][tests] Remove unused method CommonTestUtils#isProcessAlive(Process)
---
 .../flink/runtime/testutils/CommonTestUtils.java    | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java b/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java
index 780fef9..0ae6348 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java
@@ -120,27 +120,6 @@ public class CommonTestUtils {
 		return null;
 	}
 
-	/**
-	 * Checks whether a process is still alive. Utility method for JVM versions before 1.8,
-	 * where no direct method to check that is available.
-	 *
-	 * @param process The process to check.
-	 * @return True, if the process is alive, false otherwise.
-	 */
-	public static boolean isProcessAlive(Process process) {
-		if (process == null) {
-			return false;
-
-		}
-		try {
-			process.exitValue();
-			return false;
-		}
-		catch(IllegalThreadStateException e) {
-			return true;
-		}
-	}
-
 	public static void printLog4jDebugConfig(File file) throws IOException {
 		try (PrintWriter writer = new PrintWriter(new FileWriter(file))) {
 			writer.println("log4j.rootLogger=DEBUG, console");


[flink] 04/04: [FLINK-13508][tests] Prevent waitUntilCondition() from sleeping negative time

Posted by ga...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gary pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 1ad16bc252f1d3502a29ddb2081fdfdf3436cc55
Author: Gary Yao <ga...@apache.org>
AuthorDate: Wed Jul 31 13:41:42 2019 +0200

    [FLINK-13508][tests] Prevent waitUntilCondition() from sleeping negative time
    
    This fixes that CommonTestUtils#waitUntilCondition() may invoke Thread.sleep()
    with a negative argument.
---
 .../test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java b/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java
index b45ebd7..a58cbfd 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java
@@ -117,7 +117,8 @@ public class CommonTestUtils {
 
 	public static void waitUntilCondition(SupplierWithException<Boolean, Exception> condition, Deadline timeout, long retryIntervalMillis) throws Exception {
 		while (timeout.hasTimeLeft() && !condition.get()) {
-			Thread.sleep(Math.min(retryIntervalMillis, timeout.timeLeft().toMillis()));
+			final long timeLeft = Math.max(0, timeout.timeLeft().toMillis());
+			Thread.sleep(Math.min(retryIntervalMillis, timeLeft));
 		}
 
 		if (!timeout.hasTimeLeft()) {


[flink] 03/04: [hotfix][tests] Fix typo in method CommonTestUtils#isSteamContentEqual()

Posted by ga...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gary pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit a253fca90996365186cba61f7f52e40e677dfc27
Author: Gary Yao <ga...@apache.org>
AuthorDate: Wed Jul 31 12:08:08 2019 +0200

    [hotfix][tests] Fix typo in method CommonTestUtils#isSteamContentEqual()
    
    Rename method isSteamContentEqual() to isStreamContentEqual().
---
 .../flink/runtime/checkpoint/CheckpointCoordinatorTest.java    | 10 +++++-----
 .../runtime/state/DuplicatingCheckpointOutputStreamTest.java   |  4 ++--
 .../org/apache/flink/runtime/testutils/CommonTestUtils.java    |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinatorTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinatorTest.java
index b11bf62..18052bb 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinatorTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinatorTest.java
@@ -2867,12 +2867,12 @@ public class CheckpointCoordinatorTest extends TestLogger {
 
 				Collection<OperatorStateHandle> managedOperatorState = opState.getManagedOperatorState();
 				assertEquals(1, managedOperatorState.size());
-				assertTrue(CommonTestUtils.isSteamContentEqual(expectedManagedOpState.openInputStream(),
+				assertTrue(CommonTestUtils.isStreamContentEqual(expectedManagedOpState.openInputStream(),
 					managedOperatorState.iterator().next().openInputStream()));
 
 				Collection<OperatorStateHandle> rawOperatorState = opState.getRawOperatorState();
 				assertEquals(1, rawOperatorState.size());
-				assertTrue(CommonTestUtils.isSteamContentEqual(expectedRawOpState.openInputStream(),
+				assertTrue(CommonTestUtils.isStreamContentEqual(expectedRawOpState.openInputStream(),
 					rawOperatorState.iterator().next().openInputStream()));
 			}
 			// operator2
@@ -2888,12 +2888,12 @@ public class CheckpointCoordinatorTest extends TestLogger {
 
 				Collection<OperatorStateHandle> managedOperatorState = opState.getManagedOperatorState();
 				assertEquals(1, managedOperatorState.size());
-				assertTrue(CommonTestUtils.isSteamContentEqual(expectedManagedOpState.openInputStream(),
+				assertTrue(CommonTestUtils.isStreamContentEqual(expectedManagedOpState.openInputStream(),
 					managedOperatorState.iterator().next().openInputStream()));
 
 				Collection<OperatorStateHandle> rawOperatorState = opState.getRawOperatorState();
 				assertEquals(1, rawOperatorState.size());
-				assertTrue(CommonTestUtils.isSteamContentEqual(expectedRawOpState.openInputStream(),
+				assertTrue(CommonTestUtils.isStreamContentEqual(expectedRawOpState.openInputStream(),
 					rawOperatorState.iterator().next().openInputStream()));
 			}
 		}
@@ -3290,7 +3290,7 @@ public class CheckpointCoordinatorTest extends TestLogger {
 			ChainedStateHandle<OperatorStateHandle> expectedOpStateBackend =
 					generateChainedPartitionableStateHandle(jobVertexID, i, 2, 8, false);
 
-			assertTrue(CommonTestUtils.isSteamContentEqual(
+			assertTrue(CommonTestUtils.isStreamContentEqual(
 					expectedOpStateBackend.get(0).openInputStream(),
 					operatorState.getManagedOperatorState().iterator().next().openInputStream()));
 
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/state/DuplicatingCheckpointOutputStreamTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/state/DuplicatingCheckpointOutputStreamTest.java
index 886dbdd..330bb85 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/state/DuplicatingCheckpointOutputStreamTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/state/DuplicatingCheckpointOutputStreamTest.java
@@ -71,11 +71,11 @@ public class DuplicatingCheckpointOutputStreamTest extends TestLogger {
 		StreamStateHandle primaryStateHandle = duplicatingStream.closeAndGetPrimaryHandle();
 		StreamStateHandle secondaryStateHandle = duplicatingStream.closeAndGetSecondaryHandle();
 
-		Assert.assertTrue(CommonTestUtils.isSteamContentEqual(
+		Assert.assertTrue(CommonTestUtils.isStreamContentEqual(
 			refStateHandle.openInputStream(),
 			primaryStateHandle.openInputStream()));
 
-		Assert.assertTrue(CommonTestUtils.isSteamContentEqual(
+		Assert.assertTrue(CommonTestUtils.isStreamContentEqual(
 			refStateHandle.openInputStream(),
 			secondaryStateHandle.openInputStream()));
 
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java b/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java
index 5ce5f56..b45ebd7 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java
@@ -157,7 +157,7 @@ public class CommonTestUtils {
 		}
 	}
 
-	public static boolean isSteamContentEqual(InputStream input1, InputStream input2) throws IOException {
+	public static boolean isStreamContentEqual(InputStream input1, InputStream input2) throws IOException {
 
 		if (!(input1 instanceof BufferedInputStream)) {
 			input1 = new BufferedInputStream(input1);


[flink] 02/04: [hotfix][tests] Remove unused method CommonTestUtils#sleepUninterruptibly(long)

Posted by ga...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gary pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 3d07f5ad3275a69316fbecb75b016e8dea6bc734
Author: Gary Yao <ga...@apache.org>
AuthorDate: Wed Jul 31 12:05:15 2019 +0200

    [hotfix][tests] Remove unused method CommonTestUtils#sleepUninterruptibly(long)
---
 .../flink/runtime/testutils/CommonTestUtils.java   | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java b/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java
index 0ae6348..5ce5f56 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java
@@ -41,28 +41,6 @@ public class CommonTestUtils {
 	private static final long RETRY_INTERVAL = 100L;
 
 	/**
-	 * Sleeps for a given set of milliseconds, uninterruptibly. If interrupt is called,
-	 * the sleep will continue nonetheless.
-	 *
-	 * @param msecs The number of milliseconds to sleep.
-	 */
-	public static void sleepUninterruptibly(long msecs) {
-		
-		long now = System.currentTimeMillis();
-		long sleepUntil = now + msecs;
-		long remaining;
-		
-		while ((remaining = sleepUntil - now) > 0) {
-			try {
-				Thread.sleep(remaining);
-			}
-			catch (InterruptedException ignored) {}
-			
-			now = System.currentTimeMillis();
-		}
-	}
-
-	/**
 	 * Gets the classpath with which the current JVM was started.
 	 *
 	 * @return The classpath with which the current JVM was started.