Swallow parsing errors in parsing perf tests
This change swallows expected exceptions such as ignored overlays in the package parsing perf tests. Test: atest PackageParsingPerfTest Fixes: 179430570 Fixes: 179430077 Change-Id: Iab09d5b8ae426f2208e1fad1987dd811ab911fa6
This commit is contained in:
parent
9793a67875
commit
83d5029414
@ -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) }
|
||||
|
Loading…
x
Reference in New Issue
Block a user