diff options
author | Florian Mayer <fmayer@google.com> | 2022-03-28 23:13:35 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-03-28 23:13:35 +0000 |
commit | 87b28577e895bccef504629aa6c227253476757c (patch) | |
tree | 599fce2ebe81c58d468695203d147556507867b2 | |
parent | f35c2abebfb8a898aecf807976b50e69a0a7d2c5 (diff) | |
parent | ef11f3fc85bbc141f09fb298e4bfd69bf74c4899 (diff) | |
download | hidl-87b28577e895bccef504629aa6c227253476757c.tar.gz |
Use ro.hw_timeout_multiplier for hidl_lazy_test. am: 30a856cd47 am: 08396f0c12 am: 14c223f9a8 am: ef11f3fc85
Original change: https://android-review.googlesource.com/c/platform/system/tools/hidl/+/2043441
Change-Id: I75d5f9ba97a6b1a2cc59427fa565edb4be212e74
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | test/lazy_test/hidl_lazy_test.cpp | 10 |
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."; } |