Skip to content

Commit

Permalink
Fix flaky test ssdWriteOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
zacw7 committed Jul 16, 2024
1 parent 0adc62e commit 12c3ee6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions velox/common/caching/tests/AsyncDataCacheTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ TEST_P(AsyncDataCacheTest, ssdWriteOptions) {
{0.8, 0.95, 4UL << 20, false},
{0.8, 0.3, 32UL << 20, false},
{0.8, 0.3, 4UL << 20, true},
{0.001, 0.3, 4UL << 20, true}};
{0.0, 0.95, 0, true}};

for (const auto& testData : testSettings) {
SCOPED_TRACE(testData.debugString());
Expand All @@ -1455,14 +1455,14 @@ TEST_P(AsyncDataCacheTest, ssdWriteOptions) {
waitForPendingLoads();
auto stats = cache_->refreshStats();
if (testData.expectedSaveToSsd) {
EXPECT_GE(stats.ssdStats->entriesWritten, 0);
EXPECT_GT(stats.ssdStats->entriesWritten, 0);
} else {
EXPECT_EQ(stats.ssdStats->entriesWritten, 0);
}
if (testData.maxWriteRatio < 0.005) {
// SSD cache write rate is so small that it stops right after the
// first entry in each shard.
EXPECT_EQ(stats.ssdStats->entriesWritten, 4);
if (testData.maxWriteRatio < 0.0001) {
// SSD cache write stops right after the first entry in each shard.
// Only a few entries can be written.
EXPECT_LE(stats.ssdStats->entriesWritten, 20);
}
}
}
Expand Down

0 comments on commit 12c3ee6

Please sign in to comment.