summaryrefslogtreecommitdiffstats
path: root/sensors
diff options
context:
space:
mode:
authorPeng Xu <pengxu@google.com>2017-08-25 22:21:41 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-08-25 22:21:41 +0000
commitb8197386f9821ce6fce16d2fd79c85d65a778a4c (patch)
tree2bbf47089729273124b016ec6071ebf5423a7b68 /sensors
parent0e42ac339961d223638891cc8d8afcea7290c62c (diff)
parent751953859c82652c501952e8bb11d0bace99ca41 (diff)
downloadandroid_hardware_interfaces-b8197386f9821ce6fce16d2fd79c85d65a778a4c.tar.gz
android_hardware_interfaces-b8197386f9821ce6fce16d2fd79c85d65a778a4c.tar.bz2
android_hardware_interfaces-b8197386f9821ce6fce16d2fd79c85d65a778a4c.zip
Merge "Sensor VTS testBatchingOperation flakiness fix" into oc-dev
am: 751953859c Change-Id: I8800d11d6b137488674f3159941135bce374d3a6
Diffstat (limited to 'sensors')
-rw-r--r--sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
index 357270fb5..98b4994ab 100644
--- a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
+++ b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
@@ -1180,16 +1180,17 @@ void SensorsHidlTest::testBatchingOperation(SensorType type) {
usleep(batchingPeriodInNs / 1000 * 8 / 10);
SensorsHidlEnvironment::Instance()->setCollection(true);
- // 0.8 + 0.3 times the batching period
- // plus some time for the event to deliver
- events = collectEvents(
- batchingPeriodInNs / 1000 * 3 / 10,
- minFifoCount, true /*clearBeforeStart*/, false /*change collection*/);
+ // clean existing collections
+ collectEvents(0 /*timeLimitUs*/, 0/*nEventLimit*/,
+ true /*clearBeforeStart*/, false /*change collection*/);
+ // 0.8 + 0.2 times the batching period
+ usleep(batchingPeriodInNs / 1000 * 8 / 10);
ASSERT_EQ(flush(handle), Result::OK);
+ // plus some time for the event to deliver
events = collectEvents(allowedBatchDeliverTimeNs / 1000,
- minFifoCount, true /*clearBeforeStart*/, false /*change collection*/);
+ minFifoCount, false /*clearBeforeStart*/, false /*change collection*/);
SensorsHidlEnvironment::Instance()->setCollection(false);
ASSERT_EQ(activate(handle, 0), Result::OK);
@@ -1202,7 +1203,7 @@ void SensorsHidlTest::testBatchingOperation(SensorType type) {
}
// at least reach 90% of advertised capacity
- ASSERT_GT(nEvent, (size_t)(batchingPeriodInNs / minSamplingPeriodInNs * 9 / 10));
+ ASSERT_GT(nEvent, (size_t)(minFifoCount * 9 / 10));
}
// Test if sensor hal can do accelerometer batching properly