From a46326a51c966fcd65463635c1fd4360e3d1d231 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Tue, 27 Dec 2016 10:50:21 -0800 Subject: [PATCH] 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 --- logcat/tests/logcat_test.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/logcat/tests/logcat_test.cpp b/logcat/tests/logcat_test.cpp index 11cffe64b..725d76e89 100644 --- a/logcat/tests/logcat_test.cpp +++ b/logcat/tests/logcat_test.cpp @@ -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))); }