IMPALA-5349: flaky NoDirsAllocationError test The assertion was incorrect and racy - it is ok if the write error wins the race with the Unpin() calls, causing them to fail.
Change-Id: I023193b9ad6c6ac0ee114ad77ddf04d7d7185809 Reviewed-on: http://gerrit.cloudera.org:8080/6953 Reviewed-by: Henry Robinson <[email protected]> Reviewed-by: Dan Hecht <[email protected]> Tested-by: Impala Public 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/6a31d355 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/6a31d355 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/6a31d355 Branch: refs/heads/master Commit: 6a31d355b02cbd147d4cf5f7faadfca01d328563 Parents: 21f9063 Author: Tim Armstrong <[email protected]> Authored: Mon May 22 12:05:59 2017 -0700 Committer: Impala Public Jenkins <[email protected]> Committed: Tue May 23 02:32:33 2017 +0000 ---------------------------------------------------------------------- be/src/runtime/buffered-block-mgr-test.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/6a31d355/be/src/runtime/buffered-block-mgr-test.cc ---------------------------------------------------------------------- diff --git a/be/src/runtime/buffered-block-mgr-test.cc b/be/src/runtime/buffered-block-mgr-test.cc index b8b90ee..cb294c2 100644 --- a/be/src/runtime/buffered-block-mgr-test.cc +++ b/be/src/runtime/buffered-block-mgr-test.cc @@ -1234,10 +1234,10 @@ TEST_F(BufferedBlockMgrTest, NoDirsAllocationError) { ErrorLogMap error_log; runtime_state->GetErrors(&error_log); ASSERT_TRUE(error_log.empty()); - for (int i = 0; i < blocks.size(); ++i) { - // Writes won't fail until the actual I/O is attempted. - ASSERT_OK(blocks[i]->Unpin()); - } + // Unpin the blocks. Unpinning may fail if it hits a write error before this thread is + // done unpinning. + vector<TErrorCode::type> cancelled_code = {TErrorCode::CANCELLED}; + UnpinBlocks(blocks, &cancelled_code); LOG(INFO) << "Waiting for writes."; // Write failure should cancel query.
