Skip to content

Commit 59a530d

Browse files
committed
Increase the test timeout used when waiting for events to be traced
We need to use a larger timeout while waiting for events to be traced, compared to the timeout used while waiting to receive events through the input channel. Since events are traced from a separate thread that doesn't have as high of a thread priority as the InputDispatcher's thread, the tracer is expected to lag behind the dispatcher. Bug: 323347575 Bug: 210460522 Test: inputflinger_tests --gtest_filter="*InputDisp*" --gtest_repeat=100 --gtest_break_on_failure Change-Id: I7dfe648c4de5ef39f7c44ad81b544634a54e0e68
1 parent 02c9716 commit 59a530d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

services/inputflinger/tests/FakeInputTracingBackend.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ namespace android::inputdispatcher {
2323

2424
namespace {
2525

26-
constexpr auto TRACE_TIMEOUT = std::chrono::milliseconds(100);
26+
// Use a larger timeout while waiting for events to be traced, compared to the timeout used while
27+
// waiting to receive events through the input channel. Events are traced from a separate thread,
28+
// which does not have the same high thread priority as the InputDispatcher's thread, so the tracer
29+
// is expected to lag behind the Dispatcher at times.
30+
constexpr auto TRACE_TIMEOUT = std::chrono::seconds(5);
2731

2832
base::ResultError<> error(const std::ostringstream& ss) {
2933
return base::ResultError(ss.str(), BAD_VALUE);

0 commit comments

Comments
 (0)