diff options
| author | Mark Salyzyn <salyzyn@google.com> | 2016-12-27 10:50:21 -0800 |
|---|---|---|
| committer | Mark Salyzyn <salyzyn@google.com> | 2016-12-27 19:13:00 +0000 |
| commit | a46326a51c966fcd65463635c1fd4360e3d1d231 (patch) | |
| tree | 5ded70c60d6cd56de0447ebcd6839c16f91a9576 /logcat | |
| parent | af3503cff4f98b8165d67714a6cb15f9467106ff (diff) | |
| download | system_core-a46326a51c966fcd65463635c1fd4360e3d1d231.tar.gz system_core-a46326a51c966fcd65463635c1fd4360e3d1d231.tar.bz2 system_core-a46326a51c966fcd65463635c1fd4360e3d1d231.zip | |
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
Diffstat (limited to 'logcat')
| -rw-r--r-- | logcat/tests/logcat_test.cpp | 9 |
1 files 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))); } |
