From afea6772f2fe3d23a245f00f042289a9d41a17a3 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Wed, 8 Sep 2021 14:28:37 -0700 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/21183: remove component init check from excessive resource test. This check doesn't seem high value because initializing a component only indicates a performance problem if it's slow, which is not most components, so it's likely to result in many false positives. To fix the intermittent, we won't lose much if we remove it. --- .../mozilla/fenix/perf/StartupExcessiveResourceUseTest.kt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/perf/StartupExcessiveResourceUseTest.kt b/app/src/androidTest/java/org/mozilla/fenix/perf/StartupExcessiveResourceUseTest.kt index 7746e867d..e79b74652 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/perf/StartupExcessiveResourceUseTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/perf/StartupExcessiveResourceUseTest.kt @@ -25,7 +25,6 @@ import org.mozilla.fenix.helpers.HomeActivityTestRule private const val EXPECTED_SUPPRESSION_COUNT = 19 @Suppress("TopLevelPropertyNaming") // it's silly this would have a different naming convention b/c no const private val EXPECTED_RUNBLOCKING_RANGE = 0..1 // CI has +1 counts compared to local runs: increment these together -private const val EXPECTED_COMPONENT_INIT_COUNT = 50 private const val EXPECTED_VIEW_HIERARCHY_DEPTH = 12 private const val EXPECTED_RECYCLER_VIEW_CONSTRAINT_LAYOUT_CHILDREN = 4 private const val EXPECTED_NUMBER_OF_INFLATION = 12 @@ -40,11 +39,6 @@ private val failureMsgRunBlocking = getErrorMessage( implications = "using runBlocking may block the main thread and have other negative performance implications?" ) -private val failureMsgComponentInit = getErrorMessage( - shortName = "Component init", - implications = "initializing new components on start up may be an indication that we're doing more work than necessary on start up?" -) - private val failureMsgViewHierarchyDepth = getErrorMessage( shortName = "view hierarchy depth", implications = "having a deep view hierarchy can slow down measure/layout performance?" @@ -93,7 +87,6 @@ class StartupExcessiveResourceUseTest { // causing this number to fluctuate depending on device speed. We'll deal with it if it occurs. val actualSuppresionCount = activityTestRule.activity.components.strictMode.suppressionCount.get().toInt() val actualRunBlocking = RunBlockingCounter.count.get() - val actualComponentInitCount = ComponentInitCount.count.get() val rootView = activityTestRule.activity.findViewById(R.id.rootContainer) val actualViewHierarchyDepth = countAndLogViewHierarchyDepth(rootView, 1) @@ -103,7 +96,6 @@ class StartupExcessiveResourceUseTest { assertEquals(failureMsgStrictMode, EXPECTED_SUPPRESSION_COUNT, actualSuppresionCount) assertTrue(failureMsgRunBlocking + "actual: $actualRunBlocking", actualRunBlocking in EXPECTED_RUNBLOCKING_RANGE) - assertEquals(failureMsgComponentInit, EXPECTED_COMPONENT_INIT_COUNT, actualComponentInitCount) assertEquals(failureMsgViewHierarchyDepth, EXPECTED_VIEW_HIERARCHY_DEPTH, actualViewHierarchyDepth) assertEquals( failureMsgRecyclerViewConstraintLayoutChildren,