Skip to content

Commit a93496f

Browse files
Treehugger RobotAndroid (Google) Code Review
authored andcommitted
Merge "ExternalStylusIntegrationTest: Reduce likelihood for flake" into main
2 parents 3ef7a98 + 3ef3c4d commit a93496f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

services/inputflinger/tests/InputReader_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2474,10 +2474,10 @@ TEST_F(ExternalStylusIntegrationTest, FusedExternalStylusPressureNotReported) {
24742474
const auto syncTime = std::chrono::system_clock::now();
24752475
// After 72 ms, the event *will* be generated. If we wait the full 72 ms to check that NO event
24762476
// is generated in that period, there will be a race condition between the event being generated
2477-
// and the test's wait timeout expiring. Thus, we wait for a shorter duration in the test, which
2478-
// will reduce the liklihood of the race condition occurring.
2479-
const auto waitUntilTimeForNoEvent =
2480-
syncTime + std::chrono::milliseconds(ns2ms(EXTERNAL_STYLUS_DATA_TIMEOUT / 2));
2477+
// and the test's wait timeout expiring. Thus, we wait for a shorter duration in the test to
2478+
// ensure the event is not immediately generated, which should reduce the liklihood of the race
2479+
// condition occurring.
2480+
const auto waitUntilTimeForNoEvent = syncTime + std::chrono::milliseconds(1);
24812481
mDevice->sendSync();
24822482
ASSERT_NO_FATAL_FAILURE(mTestListener->assertNotifyMotionWasNotCalled(waitUntilTimeForNoEvent));
24832483

0 commit comments

Comments
 (0)