From 0d1929162f232a4f63a276dd4a391e384f58080a Mon Sep 17 00:00:00 2001 From: Nathan Kulczak Date: Mon, 31 Oct 2022 15:13:13 +0000 Subject: [PATCH] vibrator/vts: Update tests for short durations Add minimum wait time for effect completion. Effects with short durations were not completing in time with current wait time estimation. Bug: 240946208 Test: Ran updated tests Change-Id: I40f65244c3478fb2f0a3b84c3991313ad5e28cd9 Signed-off-by: Nathan Kulczak --- vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp index f50a5e744f..c88cb594f9 100644 --- a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp +++ b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp @@ -602,10 +602,11 @@ TEST_P(VibratorAidl, ComposeCallback) { EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, callback).exceptionCode()) << toString(primitive); - //TODO(b/187207798): revert back to conservative timeout values once - //latencies have been fixed - EXPECT_EQ(completionFuture.wait_for(duration * 4), std::future_status::ready) - << toString(primitive); + // TODO(b/261130361): Investigate why latency from driver and hardware will cause test + // to fail when wait duration is ~40ms or less. + EXPECT_EQ(completionFuture.wait_for(duration + std::chrono::milliseconds(50)), + std::future_status::ready) + << toString(primitive); end = high_resolution_clock::now(); elapsed = std::chrono::duration_cast(end - start);