summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2021-02-02 10:15:40 -0800
committerDaniel Velazco <velazcod@google.com>2021-12-09 17:50:41 +0000
commit79810fc16013e177a23249c6ff25d1395b6fd210 (patch)
tree1530cf0f95976f47c51ebc1a34ea0a29457da3ba
parent26d94ee676a285179ed0a9e27d0ca619bbcc5b6d (diff)
downloadextras-79810fc16013e177a23249c6ff25d1395b6fd210.tar.gz
simpleperf: Loose time constraint to fix flaky test.
DO NOT MERGE Bug: 179088910 Bug: 199771629 Test: run simpleperf_unit_test Change-Id: Ia58a5bd6e9bfff4ef208701f43541ba98a97fba0 (cherry picked from commit 3c1f59fcd18527d58bc42f3e1e73981594bb1b9b)
-rw-r--r--simpleperf/IOEventLoop_test.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/simpleperf/IOEventLoop_test.cpp b/simpleperf/IOEventLoop_test.cpp
index 9363bbc0..3578912f 100644
--- a/simpleperf/IOEventLoop_test.cpp
+++ b/simpleperf/IOEventLoop_test.cpp
@@ -143,7 +143,7 @@ void TestPeriodicEvents(int period_in_us, int iterations, bool precise) {
double time_used = std::chrono::duration_cast<std::chrono::duration<double>>(
end_time - start_time).count();
double min_time_in_sec = period_in_us / 1e6 * iterations;
- double max_time_in_sec = min_time_in_sec + (precise ? 0.1 : 1);
+ double max_time_in_sec = min_time_in_sec + (precise ? 0.3 : 1);
ASSERT_GE(time_used, min_time_in_sec);
ASSERT_LT(time_used, max_time_in_sec);
}