SF: reduce timeout for unit tests
change the timeout used in transaction application
to make the unit tests run faster.
Bug: 198190384
Test: libsurfaceflinger_unittest
Change-Id: I92e19f1b2957b406c1b61d0b948c3fb0c1f61d6c
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index aa371cb..f916881 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3931,7 +3931,8 @@
// been applied by SF
if (state.flags & eAnimation) {
while (itr != mPendingTransactionQueues.end()) {
- status_t err = mTransactionQueueCV.waitRelative(mQueueLock, s2ns(5));
+ status_t err =
+ mTransactionQueueCV.waitRelative(mQueueLock, mAnimationTransactionTimeout);
if (CC_UNLIKELY(err != NO_ERROR)) {
ALOGW_IF(err == TIMED_OUT,
"setTransactionState timed out "
@@ -3967,7 +3968,8 @@
// applyTransactionState is called on the main SF thread. While a given process may wish
// to wait on synchronous transactions, the main SF thread should apply the transaction and
// set the value to notify this after committed.
- if (!transactionCommittedSignal.wait_until(std::chrono::seconds(5))) {
+ if (!transactionCommittedSignal.wait_until(
+ std::chrono::nanoseconds(mAnimationTransactionTimeout))) {
ALOGE("setTransactionState timed out!");
}
}