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

Commit f81dc291 authored by vadimt's avatar vadimt
Browse files

Events: moving logcat filter 1 sec back

I saw flakes when logcat didn't return records that are 300ms after the
specified time. I hope that moving the start time 1 sec back will
workaround this.

Change-Id: I6a4b66094d38f555d10284f19a71152a8be47b2e
parent 352e750e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1213,9 +1213,12 @@ public final class LauncherInstrumentation {
    private List<String> getEvents() {
        final ArrayList<String> events = new ArrayList<>();
        try {
            // Logcat may skip events after the specified time. Querying for events starting 1 sec
            // earlier.
            final Date startTime = new Date(mStartRecordingTime.getTime() - 1000);
            final String logcatEvents = mDevice.executeShellCommand(
                    "logcat -d -v year --pid=" + getPid() + " -t "
                            + DATE_TIME_FORMAT.format(mStartRecordingTime).replaceAll(" ", "")
                            + DATE_TIME_FORMAT.format(startTime).replaceAll(" ", "")
                            + " -s " + TestProtocol.TAPL_EVENTS_TAG);
            final Matcher matcher = EVENT_LOG_ENTRY.matcher(logcatEvents);
            while (matcher.find()) {