Add comment explaining usage Schedulers.trampoline in detail

This commit is contained in:
XiangRongLin 2021-07-06 16:13:16 +02:00
parent 56ea526cce
commit 2aa5f68b7b
1 changed files with 4 additions and 1 deletions

View File

@ -8,7 +8,10 @@ import org.junit.runner.Description
import org.junit.runners.model.Statement
/**
* Always run on [Schedulers.trampoline]
* Always run on [Schedulers.trampoline].
* This executes the task in the current thread in FIFO manner.
* This ensures that tasks are run quickly inside the tests
* and not scheduled away to another thread for later execution
*/
class TrampolineSchedulerRule : TestRule {