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

Commit 45b9567d authored by Biswarup Pal's avatar Biswarup Pal
Browse files

Fix SettingsStateTest#testNoWriteForVirtualDevice

The test testReadWriteForDefaultDevice calls
SettingsState#insertSettingsLocked which posts messages
into a handler with a delay, which causes write operation
into a file (to persist settings). SettingsStae#waitForHandler
doesn't handle this case, as it immediately posts a message
into the handler and waits for it to execute. As a result, the
file write operation sometimes happens asynchronously while
testNoWriteForVirtualDevice is executing (where we verify that a
settings file should not exist for virtual device settings), and this
makes the test flaky. To solve this, use a different File object
for testNoWriteForVirtualDevice.

Test: atest SettingsStateTest#testNoWriteForVirtualDevice
Fixes: 413049126
Flag: EXEMPT test fix
Change-Id: Ia3eb9a47565c856c98e1929e85e139ddc7982088
parent 2379ed99
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment