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/04 15:17:04 UTC

[2/2] 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/d6dad9cd
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/d6dad9cd
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/d6dad9cd

Branch: refs/heads/master
Commit: d6dad9cdf8b6d2bf10ed3b54e00ca3765638c7a7
Parents: 2f6bd64
Author: Tim Armstrong <ta...@cloudera.com>
Authored: Thu May 3 16:05:53 2018 -0700
Committer: Impala Public Jenkins <im...@cloudera.com>
Committed: Fri May 4 03:10:50 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/d6dad9cd/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())