commit | 8c89ae56266d8357e1ef2cf5b9b084ee946c0fb9 | [log] [tgz] |
---|---|---|
author | JW Wang <wangchun@google.com> | Mon Sep 02 06:45:04 2019 +0000 |
committer | JW Wang <wangchun@google.com> | Thu Sep 05 10:41:46 2019 +0800 |
tree | b2152fbb887c2cb910c6459889c6ddfee0bc7bcd | |
parent | 82bbb6525ea2dc4ea660da4f7cceb30bc0280ed1 [diff] |
Replace Thread.sleep() with TestLooper.moveTimeForward() TestLooper.moveTimeForward() changes the target delivery time of the messages in the queue to simulate elapsed time. This allows tests to run faster in a more deterministic way without incurring the indeterminism caused by Thread.sleep() which is usually a source of flakiness and should be avoided when possible. Bug: 140208026 Test: atest PackageWatchdogTest Change-Id: I3365093838ec9fa2de5742359f6947379add7703