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

Commit e320cdb4 authored by Keun young Park's avatar Keun young Park Committed by Keun-young Park
Browse files

Test flaky test: Always wait for handle task to complete

- Previous logic of checking queue to wait or not has race as queue can be
  emptied while posted task is not complete.
- Do not check queue and always wait for new post to complete.

Bug: 129896850
Test: Run the test many times
Change-Id: Ie0e4447cf997cbe343c7e00a8dfd0757b061b547
(cherry picked from commit 819d7406)
parent dd07ae57
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -484,9 +484,6 @@ public class UserControllerTest {

    private void waitForHandlerToComplete(Handler handler, long waitTimeMs)
            throws InterruptedException {
        if (!handler.hasMessagesOrCallbacks()) { // if nothing queued, do not wait.
            return;
        }
        final Object lock = new Object();
        synchronized (lock) {
            handler.post(() -> {