flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject flink git commit: [FLINK-7233] [tests] Fix instable TaskManagerHeapSizeCalculationJavaBashTest
Date Thu, 20 Jul 2017 13:08:21 GMT
Repository: flink
Updated Branches:
  refs/heads/release-1.3 d2a68f0ed -> 129a82fba


[FLINK-7233] [tests] Fix instable TaskManagerHeapSizeCalculationJavaBashTest

This fixes getRandomConfig() being prone to integer overflows and creating
invalid configuration values.

This closes #4378


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

Branch: refs/heads/release-1.3
Commit: 129a82fbadaddf9befef86cc20797d698ee92e96
Parents: d2a68f0
Author: Nico Kruber <nico@data-artisans.com>
Authored: Thu Jul 20 11:44:08 2017 +0200
Committer: Stephan Ewen <sewen@apache.org>
Committed: Thu Jul 20 15:07:47 2017 +0200

----------------------------------------------------------------------
 .../flink/dist/TaskManagerHeapSizeCalculationJavaBashTest.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/129a82fb/flink-dist/src/test/java/org/apache/flink/dist/TaskManagerHeapSizeCalculationJavaBashTest.java
----------------------------------------------------------------------
diff --git a/flink-dist/src/test/java/org/apache/flink/dist/TaskManagerHeapSizeCalculationJavaBashTest.java
b/flink-dist/src/test/java/org/apache/flink/dist/TaskManagerHeapSizeCalculationJavaBashTest.java
index 11d8ec7..7e43b57 100644
--- a/flink-dist/src/test/java/org/apache/flink/dist/TaskManagerHeapSizeCalculationJavaBashTest.java
+++ b/flink-dist/src/test/java/org/apache/flink/dist/TaskManagerHeapSizeCalculationJavaBashTest.java
@@ -180,7 +180,7 @@ public class TaskManagerHeapSizeCalculationJavaBashTest extends TestLogger
{
 		// note: we are testing with integers only here to avoid overly complicated checks for
 		// overflowing or negative Long values - this should be enough for any practical scenario
 		// though
-		long min = TaskManagerOptions.MEMORY_SEGMENT_SIZE.defaultValue() + ran.nextInt(Integer.MAX_VALUE);
+		long min = (long) TaskManagerOptions.MEMORY_SEGMENT_SIZE.defaultValue() + ran.nextInt(Integer.MAX_VALUE);
 		long max = ran.nextInt(Integer.MAX_VALUE) + min;
 
 		int javaMemMB = Math.max((int) (max >> 20), ran.nextInt(Integer.MAX_VALUE)) + 1;


Mime
View raw message