From 1426f33bc3cd80c4d47dfb88eda5482cd14bd7eb Mon Sep 17 00:00:00 2001 From: Jialiang Tan Date: Sun, 28 Apr 2024 12:48:12 -0700 Subject: [PATCH] Fix MultiFragmentTest.compression (#9639) 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 https://github.com/facebookincubator/velox/issues/9453 Pull Request resolved: https://github.com/facebookincubator/velox/pull/9639 Reviewed By: xiaoxmeng Differential Revision: D56651191 Pulled By: tanjialiang fbshipit-source-id: 3bdfbe9e7fbc30ac94f92788dd2c37194d5a99b5 --- velox/exec/tests/MultiFragmentTest.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/velox/exec/tests/MultiFragmentTest.cpp b/velox/exec/tests/MultiFragmentTest.cpp index ba061d4cf250..3503795bd447 100644 --- a/velox/exec/tests/MultiFragmentTest.cpp +++ b/velox/exec/tests/MultiFragmentTest.cpp @@ -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())) @@ -2034,7 +2033,9 @@ TEST_F(MultiFragmentTest, compression) { const auto expected = makeRowVector({makeFlatVector(std::vector{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); @@ -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