Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59a530dc authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

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
parent 02c97164
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -23,7 +23,11 @@ namespace android::inputdispatcher {

namespace {

constexpr auto TRACE_TIMEOUT = std::chrono::milliseconds(100);
// 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. Events are traced from a separate thread,
// which does not have the same high thread priority as the InputDispatcher's thread, so the tracer
// is expected to lag behind the Dispatcher at times.
constexpr auto TRACE_TIMEOUT = std::chrono::seconds(5);

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