RedJocker / fix-PhotoEditor

0 stars 0 forks source link

use of idle() instead of idleFor() #4

Closed RedJocker closed 2 years ago

RedJocker commented 2 years ago

tests use Shadows.shadowOf(Looper.getMainLooper()).idle() on stage4 and stage5.

tests can end with unexecuted task on the looper queue
Should probably be using Shadows.shadowOf(Looper.getMainLooper()).idleFor(time, TimeUnit.MILLISECONDS) or maybeShadows.shadowOf(Looper.getMainLooper()).runToEndOfTasks() instead.

Thread.sleep may still required because of issues with shadowing of time on roboletric

also there is a questionable use of runBlocking { } probably not needed

RedJocker commented 2 years ago

solved for stage4 on fixTestsBranch

RedJocker commented 2 years ago

solved for stage5 on fixTestsBranch

RedJocker commented 2 years ago

solved for stage6 on fixTestsBranch