Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae41943b authored by Chalard Jean's avatar Chalard Jean
Browse files

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
parent 77c5dabb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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