Run testSerializeFontMap longer.

This CL partially reverts
commit cc3315a297
because testSerializeFontMap was more stable with the default
warmup duration (5s) and default target duration (16s).

Based on the logs from continuous test execution, it looks like
testSerializeFontMap is executed right after the device is booted,
and background app activities make test results unstable.

Note that testSerializeFontMap results were somewhat unstable even
before we migrated from BenchmarkState to ManualBenchmarkState in
commit 9feb92f945.
ManualBenchmarkState with shorter duration exaggerates the issue because
BenchmarkState repeats one test 5 times but ManualBenchmarkState
does not repeat tests.

Bug: 239758440
Test: atest CorePerfTests:android.graphics.perftests.TypefaceSerializationPerfTest#testSerializeFontMap
Change-Id: Ic8bdcfd5e6fd670e3a23f219267a08a064fc02bf
This commit is contained in:
Kohsuke Yatoh
2022-08-17 06:57:21 +00:00
parent 71dcdd6664
commit b31100dae0

View File

@@ -59,9 +59,8 @@ public class TypefaceSerializationPerfTest {
Typeface.loadPreinstalledSystemFontMap();
}
@ManualBenchmarkState.ManualBenchmarkTest(
warmupDurationNs = WARMUP_DURATION_NS,
targetTestDurationNs = TARGET_TEST_DURATION_NS)
// testSerializeFontMap uses the default targetTestDurationNs, which is much longer than
// TARGET_TEST_DURATION_NS, in order to stabilize test results.
@Test
public void testSerializeFontMap() throws Exception {
Map<String, Typeface> systemFontMap = Typeface.getSystemFontMap();