mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
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
This commit is contained in:
@@ -553,8 +553,6 @@ TEST_P(VibratorAidl, ComposeSizeBoundary) {
|
||||
}
|
||||
|
||||
TEST_P(VibratorAidl, ComposeCallback) {
|
||||
constexpr std::chrono::milliseconds allowedLatency{10};
|
||||
|
||||
if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
|
||||
std::vector<CompositePrimitive> supported;
|
||||
|
||||
@@ -586,17 +584,16 @@ TEST_P(VibratorAidl, ComposeCallback) {
|
||||
<< 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user