diff options
| author | 2025-01-02 15:12:34 -0800 | |
|---|---|---|
| committer | 2025-01-02 15:12:34 -0800 | |
| commit | a93496f275a8aceb96e3fc45c92f5a2ca8f5a9af (patch) | |
| tree | 7be82655d55ccd26f32dcc7c8ddc5901c515ef22 | |
| parent | 3ef7a986670f4f956a65726a9e85fee7ac293707 (diff) | |
| parent | 3ef3c4d9544b7b4d18e72c5783bd3e34d32047f9 (diff) | |
Merge "ExternalStylusIntegrationTest: Reduce likelihood for flake" into main
| -rw-r--r-- | services/inputflinger/tests/InputReader_test.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/services/inputflinger/tests/InputReader_test.cpp b/services/inputflinger/tests/InputReader_test.cpp index 9d2256f52f..0906536e32 100644 --- a/services/inputflinger/tests/InputReader_test.cpp +++ b/services/inputflinger/tests/InputReader_test.cpp @@ -2474,10 +2474,10 @@ TEST_F(ExternalStylusIntegrationTest, FusedExternalStylusPressureNotReported) { const auto syncTime = std::chrono::system_clock::now(); // After 72 ms, the event *will* be generated. If we wait the full 72 ms to check that NO event // is generated in that period, there will be a race condition between the event being generated - // and the test's wait timeout expiring. Thus, we wait for a shorter duration in the test, which - // will reduce the liklihood of the race condition occurring. - const auto waitUntilTimeForNoEvent = - syncTime + std::chrono::milliseconds(ns2ms(EXTERNAL_STYLUS_DATA_TIMEOUT / 2)); + // and the test's wait timeout expiring. Thus, we wait for a shorter duration in the test to + // ensure the event is not immediately generated, which should reduce the liklihood of the race + // condition occurring. + const auto waitUntilTimeForNoEvent = syncTime + std::chrono::milliseconds(1); mDevice->sendSync(); ASSERT_NO_FATAL_FAILURE(mTestListener->assertNotifyMotionWasNotCalled(waitUntilTimeForNoEvent)); |