From b31100dae0d808602bd45a1f9c83e8e07d3785ff Mon Sep 17 00:00:00 2001 From: Kohsuke Yatoh Date: Wed, 17 Aug 2022 06:57:21 +0000 Subject: [PATCH] Run testSerializeFontMap longer. This CL partially reverts commit cc3315a297a9d087ce51a5f87f5370193bad6d46 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 9feb92f9454cabc44cdce493ee11c34a4bc9b72b. 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 --- .../graphics/perftests/TypefaceSerializationPerfTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apct-tests/perftests/core/src/android/graphics/perftests/TypefaceSerializationPerfTest.java b/apct-tests/perftests/core/src/android/graphics/perftests/TypefaceSerializationPerfTest.java index 3a23b54916782..bc8fc53cc4480 100644 --- a/apct-tests/perftests/core/src/android/graphics/perftests/TypefaceSerializationPerfTest.java +++ b/apct-tests/perftests/core/src/android/graphics/perftests/TypefaceSerializationPerfTest.java @@ -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 systemFontMap = Typeface.getSystemFontMap();