summaryrefslogtreecommitdiff
path: root/apct-tests/perftests
diff options
context:
space:
mode:
authorPatrick Baumann <patb@google.com>2021-04-01 11:34:59 -0700
committerPatrick Baumann <patb@google.com>2021-04-01 18:42:44 +0000
commitcdce73aa654cbdb3359fb47f0d17345dd97d2431 (patch)
treec06afaa6a50525e50ca55e2289119f00521a310c /apct-tests/perftests
parentd4f0220d2921bd4cbe697b5c45f888a56cf95722 (diff)
Fix parallelNoCache perf test
This change catches exceptions while parsing and ensures that we add something to the queue being analyzed, else we block until timeout for each failure for each iteration leading to test timeouts on devices with APKs that won't parse (some for expected reasons). Fixes: 179430570 Test: atest PackageParsingPerfTest Change-Id: I5287c48a8fa54cd44cf8b7433f8bb2536a3743b3
Diffstat (limited to 'apct-tests/perftests')
-rw-r--r--apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt10
1 files changed, 9 insertions, 1 deletions
diff --git a/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt b/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt
index d5ed95f18f93..90dca25b3b70 100644
--- a/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt
+++ b/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt
@@ -159,7 +159,15 @@ class PackageParsingPerfTest {
PARALLEL_MAX_THREADS, "package-parsing-test",
Process.THREAD_PRIORITY_FOREGROUND)
- fun submit(file: File) = service.submit { queue.put(parse(file)) }
+ fun submit(file: File) {
+ service.submit {
+ try {
+ queue.put(parse(file))
+ } catch (e: Exception) {
+ queue.put(e)
+ }
+ }
+ }
fun take() = queue.poll(QUEUE_POLL_TIMEOUT_SECONDS, TimeUnit.SECONDS)