You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2018/05/07 16:43:00 UTC

[2/4] impala git commit: IMPALA-6968: Fix TestBlockVerification flakiness

IMPALA-6968: Fix TestBlockVerification flakiness

The bug is that the byte in the encrypted data is '?' around 1/256 runs
of the test. Instead, flip a bit in the original data so that it's
always different from the input.

Change-Id: Ibdf063ff32848035af667c7cd2a1268f5b785cfe
Reviewed-on: http://gerrit.cloudera.org:8080/10301
Reviewed-by: Sailesh Mukil <sa...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


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

Branch: refs/heads/2.x
Commit: d1476d1e06dded6ca0f78aebc879f7ca34ee685b
Parents: ab87d1b
Author: Tim Armstrong <ta...@cloudera.com>
Authored: Thu May 3 16:05:53 2018 -0700
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Sat May 5 19:10:18 2018 +0000

----------------------------------------------------------------------
 be/src/runtime/tmp-file-mgr-test.cc | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/d1476d1e/be/src/runtime/tmp-file-mgr-test.cc
----------------------------------------------------------------------
diff --git a/be/src/runtime/tmp-file-mgr-test.cc b/be/src/runtime/tmp-file-mgr-test.cc
index 6f82658..9eb197e 100644
--- a/be/src/runtime/tmp-file-mgr-test.cc
+++ b/be/src/runtime/tmp-file-mgr-test.cc
@@ -541,9 +541,12 @@ void TmpFileMgrTest::TestBlockVerification() {
   WaitForCallbacks(1);
 
   // Modify the data in the scratch file and check that a read error occurs.
+  LOG(INFO) << "Corrupting " << file_path;
+  uint8_t corrupt_byte = data[0] ^ 1;
   FILE* file = fopen(file_path.c_str(), "rb+");
-  fputc('?', file);
-  fclose(file);
+  ASSERT_TRUE(file != nullptr);
+  ASSERT_EQ(corrupt_byte, fputc(corrupt_byte, file));
+  ASSERT_EQ(0, fclose(file));
   vector<uint8_t> tmp;
   tmp.resize(data.size());
   Status read_status = file_group.Read(handle.get(), MemRange(tmp.data(), tmp.size()));
@@ -552,7 +555,8 @@ void TmpFileMgrTest::TestBlockVerification() {
       << read_status.GetDetail();
 
   // Modify the data in memory. Restoring the data should fail.
-  data[0] = '?';
+  LOG(INFO) << "Corrupting data in memory";
+  data[0] = corrupt_byte;
   Status restore_status = file_group.RestoreData(move(handle), data_mem_range);
   LOG(INFO) << restore_status.GetDetail();
   EXPECT_EQ(TErrorCode::SCRATCH_READ_VERIFY_FAILED, restore_status.code())