From 87c558e094043c5451659c59d38ffc1bd6de781a Mon Sep 17 00:00:00 2001 From: Yenda Li Date: Wed, 25 Dec 2024 11:30:50 -0800 Subject: [PATCH] fix: flaky abort exchange test (#11961) Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/11961 Similar to other tests in MultiFragmentTest, we need to wait for the terminate functions to execute Reviewed By: amitkdutta Differential Revision: D67636573 fbshipit-source-id: a8982f303972e77b7940d4dd0d728c33f07056f8 --- velox/exec/tests/MultiFragmentTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/velox/exec/tests/MultiFragmentTest.cpp b/velox/exec/tests/MultiFragmentTest.cpp index 69d4e97838a1..b8d3fd0aaaba 100644 --- a/velox/exec/tests/MultiFragmentTest.cpp +++ b/velox/exec/tests/MultiFragmentTest.cpp @@ -512,6 +512,10 @@ TEST_P(MultiFragmentTest, abortMergeExchange) { // Ensure that the threads in the executor can gracefully join executor.join(); + /* sleep override */ + // Wait till all the terminations, closures and destructions are done. + std::this_thread::sleep_for(std::chrono::seconds(1)); + // The references to mergeTask should be two, one for the local variable // itself and one reference inside tasks variable. EXPECT_EQ(mergeTask.use_count(), 2);