Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.8 3da7bd683 -> e5a080e6d


ZEPPELIN-3428. Flaky test: SparkInterpreterLauncherTest

### What is this PR for?

SparkInterpreterLauncherTest will fail when you already have enviroment 
variable setup in the machine where you run the unit test.

### What type of PR is it?
[Bug Fix]

### Todos
* [ ] - Task

### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-3428

### How should this be tested?
* CI pass

### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Jeff Zhang <zjf...@apache.org>

Closes #2943 from zjffdu/ZEPPELIN-3428 and squashes the following commits:

6b89b22 [Jeff Zhang] ZEPPELIN-3428. Flaky test: SparkInterpreterLauncherTest

(cherry picked from commit 806831454502d052f504d162bf6d6ab0aad02920)
Signed-off-by: Jeff Zhang <zjf...@apache.org>


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

Branch: refs/heads/branch-0.8
Commit: e5a080e6d3357d7afc7d43765772b1dda318305f
Parents: 3da7bd6
Author: Jeff Zhang <zjf...@apache.org>
Authored: Wed Apr 25 08:31:56 2018 +0800
Committer: Jeff Zhang <zjf...@apache.org>
Committed: Wed Apr 25 17:43:53 2018 +0800

----------------------------------------------------------------------
 .../launcher/SparkInterpreterLauncherTest.java            | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e5a080e6/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
----------------------------------------------------------------------
diff --git 
a/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
 
b/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
index eb44809..ef5a04e 100644
--- 
a/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
+++ 
b/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
@@ -50,7 +50,7 @@ public class SparkInterpreterLauncherTest {
     
assertTrue(interpreterProcess.getInterpreterDir().endsWith("/interpreter/spark"));
     
assertTrue(interpreterProcess.getLocalRepoDir().endsWith("/local-repo/groupId"));
     assertEquals(zConf.getInterpreterRemoteRunnerPath(), 
interpreterProcess.getInterpreterRunner());
-    assertEquals(2, interpreterProcess.getEnv().size());
+    assertTrue(interpreterProcess.getEnv().size() >= 2);
     assertEquals("/user/spark", interpreterProcess.getEnv().get("SPARK_HOME"));
     assertEquals(" --master local[*] --conf spark.files='file_1' --conf 
spark.jars='jar_1'", interpreterProcess.getEnv().get("ZEPPELIN_SPARK_CONF"));
   }
@@ -75,7 +75,7 @@ public class SparkInterpreterLauncherTest {
     
assertTrue(interpreterProcess.getInterpreterDir().endsWith("/interpreter/spark"));
     
assertTrue(interpreterProcess.getLocalRepoDir().endsWith("/local-repo/groupId"));
     assertEquals(zConf.getInterpreterRemoteRunnerPath(), 
interpreterProcess.getInterpreterRunner());
-    assertEquals(2, interpreterProcess.getEnv().size());
+    assertTrue(interpreterProcess.getEnv().size() >= 2);
     assertEquals("/user/spark", interpreterProcess.getEnv().get("SPARK_HOME"));
     assertEquals(" --master yarn-client --conf spark.files='file_1' --conf 
spark.jars='jar_1' --conf spark.yarn.isPython=true", 
interpreterProcess.getEnv().get("ZEPPELIN_SPARK_CONF"));
   }
@@ -101,7 +101,7 @@ public class SparkInterpreterLauncherTest {
     
assertTrue(interpreterProcess.getInterpreterDir().endsWith("/interpreter/spark"));
     
assertTrue(interpreterProcess.getLocalRepoDir().endsWith("/local-repo/groupId"));
     assertEquals(zConf.getInterpreterRemoteRunnerPath(), 
interpreterProcess.getInterpreterRunner());
-    assertEquals(2, interpreterProcess.getEnv().size());
+    assertTrue(interpreterProcess.getEnv().size() >= 2);
     assertEquals("/user/spark", interpreterProcess.getEnv().get("SPARK_HOME"));
     assertEquals(" --master yarn --conf spark.files='file_1' --conf 
spark.jars='jar_1' --conf spark.submit.deployMode='client' --conf 
spark.yarn.isPython=true", 
interpreterProcess.getEnv().get("ZEPPELIN_SPARK_CONF"));
   }
@@ -126,7 +126,7 @@ public class SparkInterpreterLauncherTest {
     
assertTrue(interpreterProcess.getInterpreterDir().endsWith("/interpreter/spark"));
     
assertTrue(interpreterProcess.getLocalRepoDir().endsWith("/local-repo/groupId"));
     assertEquals(zConf.getInterpreterRemoteRunnerPath(), 
interpreterProcess.getInterpreterRunner());
-    assertEquals(3, interpreterProcess.getEnv().size());
+    assertTrue(interpreterProcess.getEnv().size() >= 3);
     assertEquals("/user/spark", interpreterProcess.getEnv().get("SPARK_HOME"));
     assertEquals("true", 
interpreterProcess.getEnv().get("ZEPPELIN_SPARK_YARN_CLUSTER"));
     assertEquals(" --master yarn-cluster --files 
.//conf/log4j_yarn_cluster.properties --conf spark.files='file_1' --conf 
spark.jars='jar_1' --conf spark.yarn.isPython=true", 
interpreterProcess.getEnv().get("ZEPPELIN_SPARK_CONF"));
@@ -154,7 +154,7 @@ public class SparkInterpreterLauncherTest {
     
assertTrue(interpreterProcess.getInterpreterDir().endsWith("/interpreter/spark"));
     
assertTrue(interpreterProcess.getLocalRepoDir().endsWith("/local-repo/groupId"));
     assertEquals(zConf.getInterpreterRemoteRunnerPath(), 
interpreterProcess.getInterpreterRunner());
-    assertEquals(3, interpreterProcess.getEnv().size());
+    assertTrue(interpreterProcess.getEnv().size() >= 3);
     assertEquals("/user/spark", interpreterProcess.getEnv().get("SPARK_HOME"));
     assertEquals("true", 
interpreterProcess.getEnv().get("ZEPPELIN_SPARK_YARN_CLUSTER"));
     assertEquals(" --master yarn --files .//conf/log4j_yarn_cluster.properties 
--conf spark.files='file_1' --conf spark.jars='jar_1' --conf 
spark.submit.deployMode='cluster' --conf spark.yarn.isPython=true --proxy-user 
user1", interpreterProcess.getEnv().get("ZEPPELIN_SPARK_CONF"));

Reply via email to