Repository: zeppelin Updated Branches: refs/heads/master b13cc38dc -> 467e39f37
[ZEPPELIN-2155] Flaky test: NotebookTest - NotebookTest.testPublicPrivateNewNote:11⦠### What is this PR for? - Just give some static name to note say "1111" so it is always the first note. So, this fixes `NotebookTest.testPublicPrivateNewNote:1173 expected:<2C[B7YJQ16]> but was:<2C[A45Z6X7]>` - Set ConfVars.ZEPPELIN_NOTEBOOK_PUBLIC.getVarName() to "true", just in case any test fails, this should be reset to normal This fixes `NotebookTest.testAuthorizationRoles:759 expected:<false> but was:<true>` ### What type of PR is it? [Bug Fix] ### What is the Jira issue? * [https://issues.apache.org/jira/browse/ZEPPELIN-2155](https://issues.apache.org/jira/browse/ZEPPELIN-2155) ### How should this be tested? CI should not fail with `NotebookTest.testPublicPrivateNewNote:1173 expected:<2C[B7YJQ16]> but was:<2C[A45Z6X7]>` and `NotebookTest.testAuthorizationRoles:759 expected:<false> but was:<true>` Author: Prabhjyot Singh <prabhjyotsi...@gmail.com> Closes #2070 from prabhjyotsingh/ZEPPELIN-2155 and squashes the following commits: 64e914d [Prabhjyot Singh] use contains instead of guessing the position, which in future may break. 3ca9c7b [Prabhjyot Singh] Merge remote-tracking branch 'origin/master' into ZEPPELIN-2155 0d1ebaf [Prabhjyot Singh] fix for NotebookTest.testAuthorizationRoles:759 expected:<false> but was:<true> 9a5be5b [Prabhjyot Singh] Flaky test: NotebookTest - NotebookTest.testPublicPrivateNewNote:1173 expected:<2C[B7YJQ16]> but was:<2C[A45Z6X7]> Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/467e39f3 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/467e39f3 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/467e39f3 Branch: refs/heads/master Commit: 467e39f3776d95d4123c742fb3acf9d9aa7e6bad Parents: b13cc38 Author: Prabhjyot Singh <prabhjyotsi...@gmail.com> Authored: Wed Mar 1 10:15:49 2017 +0530 Committer: Prabhjyot Singh <prabhjyotsi...@gmail.com> Committed: Thu Mar 2 10:08:58 2017 +0530 ---------------------------------------------------------------------- .../test/java/org/apache/zeppelin/notebook/NotebookTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/467e39f3/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 6799410..ae4501d 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 @@ -114,6 +114,7 @@ public class NotebookTest implements JobListenerFactory{ notebook = new Notebook(conf, notebookRepo, schedulerFactory, factory, interpreterSettingManager, this, search, notebookAuthorization, credentials); + System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_PUBLIC.getVarName(), "true"); } @After @@ -1175,13 +1176,14 @@ public class NotebookTest implements JobListenerFactory{ // create private note Note notePrivate = notebook.createNote(new AuthenticationInfo("user1")); - + // only user1 have notePrivate right after creation notes1 = notebook.getAllNotes(user1); notes2 = notebook.getAllNotes(user2); assertEquals(notes1.size(), 2); assertEquals(notes2.size(), 1); - + assertEquals(true, notes1.contains(notePrivate)); + // user1 have all rights assertEquals(notebookAuthorization.getOwners(notePrivate.getId()).size(), 1); assertEquals(notebookAuthorization.getReaders(notePrivate.getId()).size(), 1);