You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2019/04/25 22:00:16 UTC

[kudu] 01/02: [test] Deflake TestKuduScanner.testDiffScan

This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit ef3fd09f16817f7fa56f1eb8ca95be671401770e
Author: Grant Henke <gr...@apache.org>
AuthorDate: Thu Apr 25 14:43:13 2019 -0500

    [test] Deflake TestKuduScanner.testDiffScan
    
    In the case there were 0 operations the applyOperations
    method would fail.  This fixes that by returning early.
    
    Change-Id: Icde518875e568545ffab4652e510802a5ebcecb7
    Reviewed-on: http://gerrit.cloudera.org:8080/13123
    Reviewed-by: Adar Dembo <ad...@cloudera.com>
    Tested-by: Kudu Jenkins
---
 .../src/test/java/org/apache/kudu/client/TestKuduScanner.java         | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduScanner.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduScanner.java
index 186d5ea..fcc744f 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduScanner.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduScanner.java
@@ -341,6 +341,10 @@ public class TestKuduScanner {
    */
   private Map<Integer, ChangeType> applyOperations(List<Operation> operations) throws Exception {
     Map<Integer, ChangeType> results = new HashMap<>();
+    // If there are no operations, return early.
+    if (operations.isEmpty()) {
+      return results;
+    }
     KuduSession session = client.newSession();
     // On some runs, wait long enough to flush at the start.
     if (random.nextBoolean()) {