Skip to content

Commit

Permalink
Fix MultiFragmentTest.compression (#9639)
Browse files Browse the repository at this point in the history
Summary:
The test was flaky because the task created later has the same task id. If the previous task does not get deleted in time before the second task comes in, the test will fail. The fix is to give the tasks different names

#9453

Pull Request resolved: #9639

Reviewed By: xiaoxmeng

Differential Revision: D56651191

Pulled By: tanjialiang

fbshipit-source-id: 3bdfbe9e7fbc30ac94f92788dd2c37194d5a99b5
  • Loading branch information
tanjialiang authored and facebook-github-bot committed Apr 28, 2024
1 parent adc5219 commit 1426f33
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions velox/exec/tests/MultiFragmentTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,6 @@ TEST_F(MultiFragmentTest, compression) {
.values({data}, false, kNumRepeats)
.partitionedOutput({}, 1)
.planNode();
const auto producerTaskId = "local://t1";

const auto plan = test::PlanBuilder()
.exchange(asRowType(data->type()))
Expand All @@ -2034,7 +2033,9 @@ TEST_F(MultiFragmentTest, compression) {
const auto expected =
makeRowVector({makeFlatVector<int64_t>(std::vector<int64_t>{6000000})});

const auto test = [&](float minCompressionRatio, bool expectSkipCompression) {
const auto test = [&](const std::string& producerTaskId,
float minCompressionRatio,
bool expectSkipCompression) {
PartitionedOutput::testingSetMinCompressionRatio(minCompressionRatio);
auto producerTask = makeTask(producerTaskId, producerPlan);
producerTask->start(1);
Expand All @@ -2061,8 +2062,8 @@ TEST_F(MultiFragmentTest, compression) {
}
};

test(0.7, false);
test(0.0000001, true);
test("local://t1", 0.7, false);
test("local://t2", 0.0000001, true);
}

} // namespace
Expand Down

0 comments on commit 1426f33

Please sign in to comment.