commit | 3148d396c5248afc8177ab234e1f240668b0b832 | [log] [tgz] |
---|---|---|
author | Malcolm Chen <refuhoo@google.com> | Mon Mar 23 16:42:09 2020 -0700 |
committer | Xiangyu/Malcolm Chen <refuhoo@google.com> | Tue Mar 24 20:32:05 2020 +0000 |
tree | 7083184bc3d5e89287e777cda512265da7cb9b78 | |
parent | d48aa63b22ce4fe76553bf010fc4a7278c9a0527 [diff] |
Fix flaky tests in RadioOnStateListenerTest. Previous test case may set retry timeout to be 0 therefore onComplete may be triggered unexpectedly causing the next unittest to fail. Fix is at teardown we reset the values back to original. Bug: 152120370 Test: unittest Change-Id: Ib8dfc4ccb0e0f7c928fa50951863e2a563d65d09 Merged-In: Ib8dfc4ccb0e0f7c928fa50951863e2a563d65d09
diff --git a/tests/src/com/android/services/telephony/RadioOnStateListenerTest.java b/tests/src/com/android/services/telephony/RadioOnStateListenerTest.java index 25df848..d55a2fa 100644 --- a/tests/src/com/android/services/telephony/RadioOnStateListenerTest.java +++ b/tests/src/com/android/services/telephony/RadioOnStateListenerTest.java
@@ -69,6 +69,8 @@ @Override @After public void tearDown() throws Exception { + mListener.setTimeBetweenRetriesMillis(5000); + mListener.setMaxNumRetries(5); mListener.getHandler().removeCallbacksAndMessages(null); // Wait for the queue to clear... waitForHandlerAction(mListener.getHandler(), TIMEOUT_MS /*ms timeout*/);