Skip to content

Commit

Permalink
Test param tuning (LruClockTest) (#145)
Browse files Browse the repository at this point in the history
* Add diagnostic printing for sporadic test failure (LruClockTest.SyncUpdate128).

* Increase tolerances for LruClockTest.
  • Loading branch information
tonyastolfi authored Mar 18, 2024
1 parent 4a642e7 commit 0ba86e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/llfs/lru_clock.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void run_sync_update_test(const usize kNumFastThreads)
std::thread slow_thread{[&slow_thread_values] {
for (usize i = 0; i < kSlowThreadReads; ++i) {
std::this_thread::sleep_for(
std::chrono::microseconds(llfs::LRUClock::kMaxSyncDelayUsec * 10));
std::chrono::microseconds(llfs::LRUClock::kMaxSyncDelayUsec * 40));
slow_thread_values[i] = llfs::LRUClock::read_local();
}
}};
Expand Down Expand Up @@ -141,10 +141,10 @@ void run_sync_update_test(const usize kNumFastThreads)
EXPECT_GT(slow_thread_values[i] - slow_thread_values[i - 1], 50)
<< BATT_INSPECT(i) << BATT_INSPECT(slow_thread_values[i])
<< BATT_INSPECT(slow_thread_values[i - 1]) << BATT_INSPECT(max_synced_count)
<< BATT_INSPECT(max_count);
<< BATT_INSPECT(max_count) << BATT_INSPECT_RANGE(slow_thread_values);
}

EXPECT_GT(slow_thread_values.back(), kUpdatesPerThread / 2);
EXPECT_GT(slow_thread_values.back(), kUpdatesPerThread / 10);
}

TEST(LruClockTest, SyncUpdate1)
Expand Down

0 comments on commit 0ba86e1

Please sign in to comment.