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

Commit 6740e66b authored by Atif Niyaz's avatar Atif Niyaz
Browse files

Add sleep to ShouldReportStats Test in libinput_tests



Tests were flaky previously, by adding this sleep, this should should
assert that stats.shouldReport() is always true.

Test: atest LatencyStatisticsTest
Bug: 139050511
Change-Id: I9ca106fca758378eded19c6bf130aaee5387967c
Signed-off-by: default avatarAtif Niyaz <atifniyaz@google.com>
parent 3d3fa52c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <input/LatencyStatistics.h>
#include <cmath>
#include <limits>
#include <thread>

namespace android {
namespace test {
@@ -65,6 +66,8 @@ TEST(LatencyStatisticsTest, ShouldReportStats) {
    LatencyStatistics stats{0min};
    stats.addValue(5.0);

    std::this_thread::sleep_for(1us);

    ASSERT_EQ(stats.shouldReport(), true);
}