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

Commit a46326a5 authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

logcat: unit test produces log stutter

logd now counts multiple identical messages, causing messages to be
held back.  Stop doing that in the tests.  When that filter appeared,
the logcat-unit-tests went from 23 seconds to a couple of minutes of
runtime breakign the automated testing.

Test: gTest logcat-unit-tests total time less than 1 minute.
Bug: 33845198
Bug: 33535908
Change-Id: I6145bae89b6d5e5024ef4f8fe66440c9ae53f7c6
parent af3503cf
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -451,11 +451,12 @@ TEST(logcat, bad_buffer) {
      "logcat -v brief -b radio,events,bogo,system,main -g 2>/dev/null"));
}

static void caught_blocking(int /*signum*/)
static void caught_blocking(int signum)
{
    unsigned long long v = 0xDEADBEEFA55A0000ULL;

    v += getpid() & 0xFFFF;
    if (signum == 0) ++v;

    LOG_FAILURE_RETRY(__android_log_btwrite(0, EVENT_TYPE_LONG, &v, sizeof(v)));
}
@@ -520,11 +521,12 @@ TEST(logcat, blocking) {
    EXPECT_EQ(1, signals);
}

static void caught_blocking_tail(int /*signum*/)
static void caught_blocking_tail(int signum)
{
    unsigned long long v = 0xA55ADEADBEEF0000ULL;

    v += getpid() & 0xFFFF;
    if (signum == 0) ++v;

    LOG_FAILURE_RETRY(__android_log_btwrite(0, EVENT_TYPE_LONG, &v, sizeof(v)));
}
@@ -955,10 +957,11 @@ TEST(logcat, logrotate_nodir) {
                     " -n 256 -r 1024"));
}

static void caught_blocking_clear(int /*signum*/) {
static void caught_blocking_clear(int signum) {
    unsigned long long v = 0xDEADBEEFA55C0000ULL;

    v += getpid() & 0xFFFF;
    if (signum == 0) ++v;

    LOG_FAILURE_RETRY(__android_log_btwrite(0, EVENT_TYPE_LONG, &v, sizeof(v)));
}