From c9dac9d447d97a77b4ed0822841fb9a353ff38c6 Mon Sep 17 00:00:00 2001 From: Jialiang Tan Date: Thu, 1 Aug 2024 10:29:22 -0700 Subject: [PATCH] Fix flaky spill test (#10629) Summary: Fast machines might be able to make each write in sub-microsecond, recorded as 0us in each stats addition. This may result in the total write time to be 0us. Loose the condition to make the test non-flaky. Pull Request resolved: https://github.com/facebookincubator/velox/pull/10629 Reviewed By: kevinwilfong Differential Revision: D60551759 Pulled By: tanjialiang fbshipit-source-id: 0c1fdc93759844ad42969827aa96e38cbc2ed48d --- velox/exec/tests/SpillTest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/velox/exec/tests/SpillTest.cpp b/velox/exec/tests/SpillTest.cpp index eb9ec10b5bde..e7cbe7a00613 100644 --- a/velox/exec/tests/SpillTest.cpp +++ b/velox/exec/tests/SpillTest.cpp @@ -291,7 +291,9 @@ class SpillTest : public ::testing::TestWithParam, ASSERT_EQ(stats.spilledFiles, expectedNumSpilledFiles); ASSERT_GT(stats.spilledBytes, 0); ASSERT_GT(stats.spillWrites, 0); - ASSERT_GT(stats.spillWriteTimeUs, 0); + // NOTE: On fast machines we might have sub-microsecond in each write, + // resulting in 0us total write time. + ASSERT_GE(stats.spillWriteTimeUs, 0); ASSERT_GE(stats.spillFlushTimeUs, 0); ASSERT_GT(stats.spilledRows, 0); // NOTE: the following stats are not collected by spill state.