flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject flink git commit: [FLINK-5528] [tests] Reduce query retry delay in QueryableStateITCase
Date Fri, 20 Jan 2017 15:55:26 GMT
Repository: flink
Updated Branches:
  refs/heads/master f266e8255 -> 8d6426320


[FLINK-5528] [tests] Reduce query retry delay in QueryableStateITCase

Using 100ms instead of the 1s previously used does not impose too much
additional query load and reduces the test suite's duration from 16-20s to
13-15s on my machine with the current set of unit tests. Further reductions
in the retry delay do not yield more improvements so far.


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

Branch: refs/heads/master
Commit: 8d64263203b4af7f3fbbe2a30ef67ddf67cc45a5
Parents: f266e82
Author: Nico Kruber <nico@data-artisans.com>
Authored: Tue Jan 17 15:01:32 2017 +0100
Committer: Ufuk Celebi <uce@apache.org>
Committed: Fri Jan 20 16:44:19 2017 +0100

----------------------------------------------------------------------
 .../flink/test/query/QueryableStateITCase.java    | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/8d642632/flink-tests/src/test/java/org/apache/flink/test/query/QueryableStateITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/query/QueryableStateITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/query/QueryableStateITCase.java
index 113f5c6..327a715 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/query/QueryableStateITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/query/QueryableStateITCase.java
@@ -94,6 +94,7 @@ import static org.junit.Assert.fail;
 public class QueryableStateITCase extends TestLogger {
 
 	private final static FiniteDuration TEST_TIMEOUT = new FiniteDuration(100, TimeUnit.SECONDS);
+	private final static FiniteDuration QUERY_RETRY_DELAY = new FiniteDuration(100, TimeUnit.MILLISECONDS);
 
 	private final static ActorSystem TEST_ACTOR_SYSTEM = AkkaUtils.createDefaultActorSystem();
 
@@ -200,8 +201,6 @@ public class QueryableStateITCase extends TestLogger {
 
 			final AtomicLongArray counts = new AtomicLongArray(numKeys);
 
-			final FiniteDuration retryDelay = new FiniteDuration(1, TimeUnit.SECONDS);
-
 			boolean allNonZero = false;
 			while (!allNonZero && deadline.hasTimeLeft()) {
 				allNonZero = true;
@@ -230,7 +229,7 @@ public class QueryableStateITCase extends TestLogger {
 							queryName,
 							key,
 							serializedKey,
-							retryDelay);
+							QUERY_RETRY_DELAY);
 
 					serializedResult.onSuccess(new OnSuccess<byte[]>() {
 						@Override
@@ -347,14 +346,13 @@ public class QueryableStateITCase extends TestLogger {
 
 			boolean success = false;
 			while (!success && deadline.hasTimeLeft()) {
-				final FiniteDuration retryDelay = new FiniteDuration(1, TimeUnit.SECONDS);
 				Future<byte[]> serializedResultFuture = getKvStateWithRetries(
 						client,
 						jobId,
 						queryName,
 						key,
 						serializedKey,
-						retryDelay);
+						QUERY_RETRY_DELAY);
 
 				byte[] serializedResult = Await.result(serializedResultFuture, deadline.timeLeft());
 
@@ -451,14 +449,13 @@ public class QueryableStateITCase extends TestLogger {
 			// Now start another task manager
 			cluster.addTaskManager();
 
-			final FiniteDuration retryDelay = new FiniteDuration(1, TimeUnit.SECONDS);
 			Future<byte[]> serializedResultFuture = getKvStateWithRetries(
 					client,
 					jobId,
 					queryName,
 					key,
 					serializedKey,
-					retryDelay);
+					QUERY_RETRY_DELAY);
 
 			byte[] serializedResult = Await.result(serializedResultFuture, deadline.timeLeft());
 
@@ -719,7 +716,7 @@ public class QueryableStateITCase extends TestLogger {
 		final QueryableStateClient client, final JobID jobId,
 		final QueryableStateStream<Integer, Tuple2<Integer, Long>> queryableState,
 		final long expected) throws Exception {
-		FiniteDuration retryDelay = new FiniteDuration(1, TimeUnit.SECONDS);
+
 		for (int key = 0; key < NUM_SLOTS; key++) {
 			final byte[] serializedKey = KvStateRequestSerializer.serializeKeyAndNamespace(
 				key,
@@ -734,7 +731,7 @@ public class QueryableStateITCase extends TestLogger {
 					queryableState.getQueryableStateName(),
 					key,
 					serializedKey,
-					retryDelay);
+					QUERY_RETRY_DELAY);
 
 				byte[] serializedValue = Await.result(future, deadline.timeLeft());
 
@@ -872,7 +869,6 @@ public class QueryableStateITCase extends TestLogger {
 			// Now query
 			String expected = Integer.toString(numElements * (numElements + 1) / 2);
 
-			FiniteDuration retryDelay = new FiniteDuration(1, TimeUnit.SECONDS);
 			for (int key = 0; key < NUM_SLOTS; key++) {
 				final byte[] serializedKey = KvStateRequestSerializer.serializeKeyAndNamespace(
 						key,
@@ -887,7 +883,7 @@ public class QueryableStateITCase extends TestLogger {
 							queryableState.getQueryableStateName(),
 							key,
 							serializedKey,
-							retryDelay);
+							QUERY_RETRY_DELAY);
 
 					byte[] serializedValue = Await.result(future, deadline.timeLeft());
 


Mime
View raw message