You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2015/11/11 16:56:33 UTC

incubator-zeppelin git commit: ZEPPELIN-315 Fix time-dependant scheduling test

Repository: incubator-zeppelin
Updated Branches:
  refs/heads/master 6aaafe1b4 -> 025ba74f3


ZEPPELIN-315 Fix time-dependant scheduling test

test-schedule can fail when it starts late in a second, as the result will then return the next second due to in-system delays (particularly cron not reacting in time to config.put(cron, null)).
Adding an additional waiting second before measuring dateFinished allows us to take a value that is independent of a possible lagging execution, waiting another second makes sure that the process has properly stopped.

Alternatively, we can test the time and make sure to not write to cron when just before the full second - that would be quicker (less waiting) but slightly more hacky.

Please review.

Author: Rick Moritz <ra...@gmail.com>

Closes #315 from RPCMoritz/patch-1 and squashes the following commits:

42ed8e1 [Rick Moritz] Fix time-dependant scheduling test


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

Branch: refs/heads/master
Commit: 025ba74f33386df99579645a666df15685c0e879
Parents: 6aaafe1
Author: Rick Moritz <ra...@gmail.com>
Authored: Mon Sep 21 19:10:37 2015 +0200
Committer: Lee moon soo <mo...@apache.org>
Committed: Thu Nov 12 00:56:47 2015 +0900

----------------------------------------------------------------------
 .../test/java/org/apache/zeppelin/notebook/NotebookTest.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/025ba74f/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java
index dad7384..31f18cf 100644
--- a/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java
+++ b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java
@@ -208,13 +208,14 @@ public class NotebookTest implements JobListenerFactory{
     note.setConfig(config);
     notebook.refreshCron(note.id());
     Thread.sleep(1*1000);
-    dateFinished = p.getDateFinished();
-    assertNotNull(dateFinished);
-
+    
     // remove cron scheduler.
     config.put("cron", null);
     note.setConfig(config);
     notebook.refreshCron(note.id());
+    Thread.sleep(1000);
+    dateFinished = p.getDateFinished();
+    assertNotNull(dateFinished);
     Thread.sleep(1*1000);
     assertEquals(dateFinished, p.getDateFinished());
   }