Repository: incubator-impala
Updated Branches:
  refs/heads/master be6a3bc1a -> 3307acfef


IMPALA-3470: DecompressorTest is flaky.

Make sure the random number is greater than 0 and stream is indeed truncated.

Change-Id: I7ebaa403abf45e31f38d6cf4e557d6274d877a8a
Reviewed-on: http://gerrit.cloudera.org:8080/3954
Reviewed-by: Juan Yu <[email protected]>
Tested-by: Internal Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/3307acfe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/3307acfe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/3307acfe

Branch: refs/heads/master
Commit: 3307acfef084ec46820dc2c8c90395908fea7ec1
Parents: be6a3bc
Author: Juan Yu <[email protected]>
Authored: Thu Aug 11 22:55:58 2016 -0700
Committer: Internal Jenkins <[email protected]>
Committed: Tue Aug 16 03:32:37 2016 +0000

----------------------------------------------------------------------
 be/src/util/decompress-test.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/3307acfe/be/src/util/decompress-test.cc
----------------------------------------------------------------------
diff --git a/be/src/util/decompress-test.cc b/be/src/util/decompress-test.cc
index bc6f6be..f139c39 100644
--- a/be/src/util/decompress-test.cc
+++ b/be/src/util/decompress-test.cc
@@ -234,8 +234,9 @@ class DecompressorTest : public ::testing::Test {
 
     // Test case 2. multistream that is truncated. We should get stream_end == 
false
     // but with no error.
-    int truncated = rand() % 512;
+    int truncated = rand() % 512 + 1;
     int64_t bytes_decompressed = 0;
+    ASSERT_LE(truncated, compressed_len);
     EXPECT_OK(StreamingDecompress(decompressor.get(), compressed_len - 
truncated,
         compressed, uncompressed_len, uncompressed, false, 
&bytes_decompressed));
     // Decompress the remaining.

Reply via email to