Skip to content
Commit bccd8ad0 authored by Hugo Benichi's avatar Hugo Benichi Committed by Lorenzo Colitti
Browse files

DO NOT MERGE: ConnectivityServiceTest: fix testAvoidBadWifiSettings

This patch introduces an assertEventuallyThat helper function in
ConnectivityServiceTest which given a boolean function retries until the
function returns true or until a maximum retry time is reached.

This function is used to fix flakyness of testAvoidBadWifiSetting where
the Message posted by reevaluate() could reach the Handler's
MessageQueue after waitForIdle takes effect, resulting in the test to
fail.

Instead of fixing the flakyness by introdcing hard sleep times,
assertEventuallyThat is used to reduce the overall test time.

With this change the test has been observed to pass with 100% success
rate over 50000 invocations.

Test: $ runtest frameworks-net
Bug: 32561414

(cherry picked from commit 99c8294e)

(cherry picked from commit 53d83d51)

Change-Id: I432f90a699dadfef37a5d0a69e25050753340964
parent de7002ef
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment