kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject kudu git commit: KUDU-1402. Ensure session.flush() returns an empty list
Date Fri, 17 Feb 2017 21:25:11 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 50801300f -> 1ff368465


KUDU-1402. Ensure session.flush() returns an empty list

Adds a test to ensure that calls to session.flush() returns an empty list

Change-Id: I410791061d2e193d6ede64bdc5fceb19502a802e
Reviewed-on: http://gerrit.cloudera.org:8080/6061
Tested-by: Kudu Jenkins
Reviewed-by: Jean-Daniel Cryans <jdcryans@apache.org>


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

Branch: refs/heads/master
Commit: 1ff368465d3df4e2ced7fa87b87faa4303ceaeee
Parents: 5080130
Author: Grant Henke <granthenke@gmail.com>
Authored: Fri Feb 17 09:39:46 2017 -0600
Committer: Jean-Daniel Cryans <jdcryans@apache.org>
Committed: Fri Feb 17 21:23:57 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/kudu/client/TestKuduSession.java | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/1ff36846/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduSession.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduSession.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduSession.java
index 55f9508..273d818 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduSession.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduSession.java
@@ -18,6 +18,7 @@ package org.apache.kudu.client;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -123,6 +124,20 @@ public class TestKuduSession extends BaseKuduTest {
   }
 
   /**
+   * Regression test for KUDU-1402. Calls to session.flush() should return an empty list
+   * instead of null.
+   * @throws Exception
+   */
+  @Test(timeout = 100000)
+  public void testEmptyFlush() throws Exception {
+    KuduSession session = syncClient.newSession();
+    session.setFlushMode(SessionConfiguration.FlushMode.MANUAL_FLUSH);
+    List<OperationResponse> result = session.flush();
+    assertNotNull(result);
+    assertTrue(result.isEmpty());
+  }
+
+  /**
    * Regression test for KUDU-1226. Calls to session.flush() concurrent with AUTO_FLUSH_BACKGROUND
    * can end up giving ConvertBatchToListOfResponsesCB a list with nulls if a tablet was
already
    * flushed. Only happens with multiple tablets.


Mime
View raw message