diff options
author | Chalard Jean <jchalard@google.com> | 2019-07-12 16:46:14 +0900 |
---|---|---|
committer | Chalard Jean <jchalard@google.com> | 2019-07-12 16:48:48 +0900 |
commit | ae41943bda154164eb0ccc357128cd5dc97eab6b (patch) | |
tree | e48292d773851f94fe9895b7fe193e163e663229 | |
parent | 77c5dabb65ae76e57d4f369ce22fd4c7df538223 (diff) |
Fix a flaky test.
Yeah so actually this is precise enough that the thread waiting
is waking up and measuring time with less than 1ms latency.
Test: 100 times each test
Fixes: 137270720
Fixes: 137162797
Fixes: 136988752
Change-Id: I7da13e1bd175288005a821d3190637cf140fc6c6
-rw-r--r-- | tests/unit/src/android/net/testutils/TrackRecordTest.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/src/android/net/testutils/TrackRecordTest.kt b/tests/unit/src/android/net/testutils/TrackRecordTest.kt index ff28933..f9d3558 100644 --- a/tests/unit/src/android/net/testutils/TrackRecordTest.kt +++ b/tests/unit/src/android/net/testutils/TrackRecordTest.kt @@ -181,7 +181,7 @@ class TrackRecordTest { var delay = measureTimeMillis { assertNull(record.poll(SHORT_TIMEOUT, 0)) } assertTrue(delay >= SHORT_TIMEOUT, "Delay $delay < $SHORT_TIMEOUT") delay = measureTimeMillis { assertNull(record.poll(SHORT_TIMEOUT, 0) { it < 10 }) } - assertTrue(delay > SHORT_TIMEOUT) + assertTrue(delay >= SHORT_TIMEOUT) } @Test @@ -209,7 +209,7 @@ class TrackRecordTest { assertTrue(delay >= SHORT_TIMEOUT, "Delay $delay < $SHORT_TIMEOUT") // Polling for an element that doesn't match what is already there delay = measureTimeMillis { assertNull(record.poll(SHORT_TIMEOUT, 0) { it < 10 }) } - assertTrue(delay > SHORT_TIMEOUT) + assertTrue(delay >= SHORT_TIMEOUT) } // Just make sure the interpreter actually throws an exception when the spec |