Skip to content

Commit

Permalink
fix: Flaky HashJoinReplayerTest.partialDriverIds (facebookincubator#1…
Browse files Browse the repository at this point in the history
…1742)

Summary:
The trace data file for driver 0 might be empty. In such a case, the replayer
would disregard the associated re-execution, thereby not triggering the injected
failure. Add a file size check before the exception asserts in `HashJoinReplayerTest.partialDriverIds`.

Fix facebookincubator#11695

Pull Request resolved: facebookincubator#11742

Reviewed By: Yuhta

Differential Revision: D66767559

Pulled By: xiaoxmeng

fbshipit-source-id: 75df35ca2a27f13f62831bceccd88415e7826e6e
  • Loading branch information
duanmeng authored and facebook-github-bot committed Dec 4, 2024
1 parent 28c319e commit 03f0894
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions velox/tool/trace/tests/HashJoinReplayerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,22 +289,25 @@ TEST_F(HashJoinReplayerTest, partialDriverIds) {
const auto opTraceDataFile = exec::trace::getOpTraceInputFilePath(opTraceDir);
auto faultyFs = faultyFileSystem();
faultyFs->setFileInjectionHook([&](FaultFileOperation* op) {
if (op->type == FaultFileOperation::Type::kRead &&
if ((op->type == FaultFileOperation::Type::kRead ||
op->type == FaultFileOperation::Type::kReadv) &&
op->path == opTraceDataFile) {
VELOX_FAIL("Read wrong data file {}", opTraceDataFile);
}
});

VELOX_ASSERT_THROW(
HashJoinReplayer(
traceRoot,
task->queryCtx()->queryId(),
task->taskId(),
traceNodeId_,
"HashJoin",
"0")
.run(),
"Read wrong data file");
if (faultyFs->openFileForRead(opTraceDataFile)->size() > 0) {
VELOX_ASSERT_THROW(
HashJoinReplayer(
traceRoot,
task->queryCtx()->queryId(),
task->taskId(),
traceNodeId_,
"HashJoin",
"0")
.run(),
"Read wrong data file");
}
HashJoinReplayer(
traceRoot,
task->queryCtx()->queryId(),
Expand Down

0 comments on commit 03f0894

Please sign in to comment.