Skip to content

Commit

Permalink
fix: unstable time record test (#3131)
Browse files Browse the repository at this point in the history
Signed-off-by: Zhenchi <[email protected]>
  • Loading branch information
zhongzc authored Jan 10, 2024
1 parent 1fc168b commit 490312b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/mito2/src/sst/index/creator/statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,25 @@ mod tests {
let mut guard = stats.record_update();
guard.inc_byte_count(100);
guard.inc_row_count(10);

let now = Instant::now();
while now.elapsed().is_zero() {
// busy loop
}
}
{
let _guard = stats.record_finish();
let now = Instant::now();
while now.elapsed().is_zero() {
// busy loop
}
}
{
let _guard = stats.record_cleanup();
let now = Instant::now();
while now.elapsed().is_zero() {
// busy loop
}
}
assert_eq!(stats.row_count(), 10);
assert_eq!(stats.byte_count(), 100);
Expand Down

0 comments on commit 490312b

Please sign in to comment.