Relax timing parameters for vibrator VTS
First we set the start timestamp before we call the compose method.
We'll increase the allowed latency to if the system is under heavy load
then there can be more latencies.
Bug: 184578694
Test: atest
Change-Id: I5c06017ab0242d32b281ff3a0d0dddcb2106de5d
diff --git a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp
index a9d1ed5..4d03ebf 100644
--- a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp
+++ b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp
@@ -553,8 +553,6 @@
}
TEST_P(VibratorAidl, ComposeCallback) {
- constexpr std::chrono::milliseconds allowedLatency{10};
-
if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
std::vector<CompositePrimitive> supported;
@@ -586,17 +584,16 @@
<< toString(primitive);
duration = std::chrono::milliseconds(durationMs);
+ start = high_resolution_clock::now();
EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, callback).exceptionCode())
<< toString(primitive);
- start = high_resolution_clock::now();
- EXPECT_EQ(completionFuture.wait_for(duration + allowedLatency), std::future_status::ready)
+ EXPECT_EQ(completionFuture.wait_for(duration * 2), std::future_status::ready)
<< toString(primitive);
end = high_resolution_clock::now();
elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
- EXPECT_LE(elapsed.count(), (duration + allowedLatency).count()) << toString(primitive);
- EXPECT_GE(elapsed.count(), (duration - allowedLatency).count()) << toString(primitive);
+ EXPECT_GE(elapsed.count(), duration.count()) << toString(primitive);
}
}
}