• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/hardware/interfaces


Commit MetaInfo

Revisionf8f4527ef9583947a69ad875e63148d73e23aabe (tree)
Zeit2019-03-22 02:31:50
AutorTri Vo <trong@goog...>
Commiterandroid-build-merger

Log Message

SystemSuspendTest.CleanupOnAbort increase timeout
am: 28d18ced6f

Change-Id: Ibc716da5ae4e2a99f346637a6a1d64dddd921c13

Ändern Zusammenfassung

Diff

--- a/suspend/1.0/default/SystemSuspendUnitTest.cpp
+++ b/suspend/1.0/default/SystemSuspendUnitTest.cpp
@@ -65,11 +65,10 @@ namespace android {
6565 static constexpr char kServiceName[] = "TestService";
6666 static constexpr char kControlServiceName[] = "TestControlService";
6767
68-static bool isReadBlocked(int fd) {
68+static bool isReadBlocked(int fd, int timeout_ms = 20) {
6969 struct pollfd pfd {
7070 .fd = fd, .events = POLLIN,
7171 };
72- int timeout_ms = 20;
7372 return poll(&pfd, 1, timeout_ms) == 0;
7473 }
7574
@@ -168,7 +167,7 @@ class SystemSuspendTest : public ::testing::Test {
168167 ASSERT_TRUE(WriteStringToFd(wakeupCount, wakeupCountFd));
169168 }
170169
171- bool isSystemSuspendBlocked() { return isReadBlocked(stateFd); }
170+ bool isSystemSuspendBlocked(int timeout_ms = 20) { return isReadBlocked(stateFd, timeout_ms); }
172171
173172 sp<IWakeLock> acquireWakeLock() {
174173 return suspendService->acquireWakeLock(WakeLockType::PARTIAL, "TestLock");
@@ -288,7 +287,9 @@ TEST_F(SystemSuspendTest, CleanupOnAbort) {
288287 ::testing::KilledBySignal(SIGABRT), "");
289288 ASSERT_TRUE(isSystemSuspendBlocked());
290289 unblockSystemSuspendFromWakeupCount();
291- ASSERT_FALSE(isSystemSuspendBlocked());
290+ // Timing of the wake lock clean-up after process death is scheduler-dependent.
291+ // Increase the timeout to avoid flakes.
292+ ASSERT_FALSE(isSystemSuspendBlocked(200));
292293 }
293294
294295 // Test that debug dump has correct information about WakeLocks.