aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Mayer <fmayer@google.com>2022-03-28 22:42:14 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-03-28 22:42:14 +0000
commit14c223f9a8f7785e6876f4fd83aa0cab1fb0d1bd (patch)
treefc66c1d88a92e272fd070bfb625a08a60d917e5f
parentcc0bad111921765622ea6b82e212a1e907d7e05f (diff)
parent08396f0c12d6381438abfe2d160cb8b0bdce9ad3 (diff)
downloadhidl-14c223f9a8f7785e6876f4fd83aa0cab1fb0d1bd.tar.gz
Use ro.hw_timeout_multiplier for hidl_lazy_test. am: 30a856cd47 am: 08396f0c12
Original change: https://android-review.googlesource.com/c/platform/system/tools/hidl/+/2043441 Change-Id: I267160d5d3bbcd97a38fbaafdbc704ecc4f0a959 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--test/lazy_test/hidl_lazy_test.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/lazy_test/hidl_lazy_test.cpp b/test/lazy_test/hidl_lazy_test.cpp
index af0e6b97..6bbb161f 100644
--- a/test/lazy_test/hidl_lazy_test.cpp
+++ b/test/lazy_test/hidl_lazy_test.cpp
@@ -25,6 +25,7 @@
#include <sys/eventfd.h>
#include <unistd.h>
+#include <android-base/properties.h>
#include <android-base/unique_fd.h>
#include <android/hardware/tests/lazy/1.1/ILazy.h>
#include <android/hardware/tests/lazy_cb/1.0/ILazyCb.h>
@@ -101,7 +102,8 @@ class HidlLazyTest : public HidlLazyTestBase {
std::cout << "Waiting " << SHUTDOWN_WAIT_TIME << " seconds before checking that the "
<< "service has shut down." << std::endl;
IPCThreadState::self()->flushCommands();
- sleep(SHUTDOWN_WAIT_TIME);
+ int timeout_multiplier = android::base::GetIntProperty("ro.hw_timeout_multiplier", 1);
+ sleep(SHUTDOWN_WAIT_TIME * timeout_multiplier);
for (const auto& instance : gInstances) {
ASSERT_FALSE(isServiceRunning(instance))
<< "Service failed to shutdown " << instance.string();
@@ -143,7 +145,8 @@ static void testWithTimes(const std::vector<size_t>& waitTimes, const FqInstance
IPCThreadState::self()->flushCommands();
std::cout << "Thread for " << instance.string() << " waiting " << sleepTime
<< " while not holding HAL." << std::endl;
- sleep(sleepTime);
+ int timeout_multiplier = android::base::GetIntProperty("ro.hw_timeout_multiplier", 1);
+ sleep(sleepTime * timeout_multiplier);
sp<IBase> hal = getHal(instance);
ASSERT_NE(hal.get(), nullptr);
ASSERT_TRUE(hal->ping().isOk());
@@ -230,7 +233,8 @@ TEST_F(HidlLazyCbTest, ActiveServicesCallbackTest) {
<< " seconds before checking whether the "
<< "service is still running." << std::endl;
- sleep(CALLBACK_SHUTDOWN_WAIT_TIME);
+ int timeout_multiplier = android::base::GetIntProperty("ro.hw_timeout_multiplier", 1);
+ sleep(CALLBACK_SHUTDOWN_WAIT_TIME * timeout_multiplier);
ASSERT_FALSE(isServiceRunning(fqInstance)) << "Service failed to shut down.";
}