Fix tests by increasing budget

This commit is contained in:
Arpad Müller
2023-10-27 05:56:03 +02:00
parent 06a9692956
commit b06f36ebca
2 changed files with 5 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ pub struct ExpCounter {
}
impl ExpCounter {
/// Creates a new `ExpCounter` instance that counts to the (exclusive) maximum
pub fn with_max(max: u64) -> Self {
Self {
max,

View File

@@ -343,7 +343,7 @@ impl Timeline {
let mut found_larger = false;
// This is a search budget to not make the search too expensive
let mut budget = 10_000u16;
let mut budget = 1_000_000u32;
while low < high {
// cannot overflow, high and low are both smaller than u64::MAX / 2
// this always holds: low <= mid_start < high
@@ -380,17 +380,17 @@ impl Timeline {
if let Some(max) = max {
if max <= search_timestamp {
found_smaller = true;
// We found a commit with timestamp before (or at) `search_timestamp`.
// set low to mid + 1
found_smaller = true;
low = mid + 1;
} else {
// We found a commit with timestamp after `search_timestamp`.
found_larger = true;
high = mid;
}
} else {
// max is None so we have proof of a chain of None's from mid_start all up to high.
// Thus we can safely set high to mid
// Thus we can safely set high to mid_start
high = mid_start;
}
}