summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-06-25 12:42:54 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-06-25 12:42:54 +0000
commita44e794dc4f360db18452e11785b1cb29e0628be (patch)
treefd7499eeb101ad961cfc546b25e8e2a7dca3145f
parent8ccde242a18af1327df260ad071d8909f4915624 (diff)
parent5a58efedd81ed5741c53e505671f19f18ab00f18 (diff)
downloadandroid_hardware_interfaces-a44e794dc4f360db18452e11785b1cb29e0628be.tar.gz
android_hardware_interfaces-a44e794dc4f360db18452e11785b1cb29e0628be.tar.bz2
android_hardware_interfaces-a44e794dc4f360db18452e11785b1cb29e0628be.zip
Snap for 5685999 from 5a58efedd81ed5741c53e505671f19f18ab00f18 to qt-release
Change-Id: I2f578ce3ac9b7e769c18f66ac8bee7b41891eefc
-rw-r--r--health/storage/1.0/vts/functional/VtsHalHealthStorageV1_0TargetTest.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/health/storage/1.0/vts/functional/VtsHalHealthStorageV1_0TargetTest.cpp b/health/storage/1.0/vts/functional/VtsHalHealthStorageV1_0TargetTest.cpp
index 946e5f247..2365124dc 100644
--- a/health/storage/1.0/vts/functional/VtsHalHealthStorageV1_0TargetTest.cpp
+++ b/health/storage/1.0/vts/functional/VtsHalHealthStorageV1_0TargetTest.cpp
@@ -35,6 +35,9 @@ using ::std::literals::chrono_literals::operator""ms;
// Dev GC timeout. This is the timeout used by vold.
const uint64_t kDevGcTimeoutSec = 120;
const std::chrono::seconds kDevGcTimeout{kDevGcTimeoutSec};
+// Dev GC timeout tolerance. The HAL may not immediately return after the
+// timeout, so include an acceptable tolerance.
+const std::chrono::seconds kDevGcTolerance{3};
// Time accounted for RPC calls.
const std::chrono::milliseconds kRpcTime{1000};
@@ -156,8 +159,9 @@ TEST_F(HealthStorageHidlTest, GcNullCallback) {
ASSERT_OK(ret);
// Hold test process because HAL can be single-threaded and doing GC.
- ASSERT_TRUE(ping(kDevGcTimeout + kRpcTime))
- << "Service must be available after " << toString(kDevGcTimeout + kRpcTime);
+ ASSERT_TRUE(ping(kDevGcTimeout + kDevGcTolerance + kRpcTime))
+ << "Service must be available after "
+ << toString(kDevGcTimeout + kDevGcTolerance + kRpcTime);
}
/**
@@ -167,7 +171,7 @@ TEST_F(HealthStorageHidlTest, GcNonNullCallback) {
sp<GcCallback> cb = new GcCallback();
auto ret = fs->garbageCollect(kDevGcTimeoutSec, cb);
ASSERT_OK(ret);
- cb->waitForResult(kDevGcTimeout + kRpcTime, Result::SUCCESS);
+ cb->waitForResult(kDevGcTimeout + kDevGcTolerance + kRpcTime, Result::SUCCESS);
}
} // namespace V1_0