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

Commit 9a5ffebb authored by Patrick Baumann's avatar Patrick Baumann Committed by Automerger Merge Worker
Browse files

Merge "Swallow parsing errors in parsing perf tests" into sc-dev am: 0b9157e6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13715287

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6bec7a61d6541ef35fa68f5539d4c96d93b1aa32
parents 81ba5ba9 0b9157e6
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -97,11 +97,21 @@ class PackageParsingPerfTest {
    private val state: BenchmarkState get() = perfStatusReporter.benchmarkState
    private val apks: List<File> get() = params.apks

    private fun safeParse(parser: ParallelParser<*>, file: File) {
        try {
            parser.parse(file)
        } catch (e: Exception) {
            // ignore
        }
    }

    @Test
    fun sequentialNoCache() {
        params.cacheDirToParser(null).use { parser ->
            while (state.keepRunning()) {
                apks.forEach { parser.parse(it) }
                apks.forEach {
                    safeParse(parser, it)
                }
            }
        }
    }
@@ -110,10 +120,10 @@ class PackageParsingPerfTest {
    fun sequentialCached() {
        params.cacheDirToParser(testFolder.newFolder()).use { parser ->
            // Fill the cache
            apks.forEach { parser.parse(it) }
            apks.forEach { safeParse(parser, it) }

            while (state.keepRunning()) {
                apks.forEach { parser.parse(it) }
                apks.forEach { safeParse(parser, it) }
            }
        }
    }
@@ -132,7 +142,7 @@ class PackageParsingPerfTest {
    fun parallelCached() {
        params.cacheDirToParser(testFolder.newFolder()).use { parser ->
            // Fill the cache
            apks.forEach { parser.parse(it) }
            apks.forEach { safeParse(parser, it) }

            while (state.keepRunning()) {
                apks.forEach { parser.submit(it) }