mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 09:58:50 +08:00
When checking whether a timeout fired too early, use a larger epsilon from the target duration.
This commit is contained in:
parent
9f70e84a7b
commit
1a1f15323a
@ -58,7 +58,7 @@ fdb_error_t wait_future(fdb::Future& f) {
|
|||||||
void validateTimeoutDuration(double expectedSeconds, std::chrono::time_point<std::chrono::steady_clock> start) {
|
void validateTimeoutDuration(double expectedSeconds, std::chrono::time_point<std::chrono::steady_clock> start) {
|
||||||
std::chrono::duration<double> duration = std::chrono::steady_clock::now() - start;
|
std::chrono::duration<double> duration = std::chrono::steady_clock::now() - start;
|
||||||
double actualSeconds = duration.count();
|
double actualSeconds = duration.count();
|
||||||
CHECK(actualSeconds >= expectedSeconds - 1e-6);
|
CHECK(actualSeconds >= expectedSeconds - 1e-3);
|
||||||
CHECK(actualSeconds < expectedSeconds * 2);
|
CHECK(actualSeconds < expectedSeconds * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user