Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

[Crash] Crash in instrumented tests: java.lang.RuntimeException: Failed to call observer method #17045

Closed
sv-ohorvath opened this issue Dec 15, 2020 · 2 comments
Assignees
Labels
b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info 🐞 bug Crashes, Something isn't working, .. eng:bug-auto-found Bug found via automated tests Feature:Accounts Feature:WebExtensions

Comments

@sv-ohorvath
Copy link
Contributor

sv-ohorvath commented Dec 15, 2020

Steps to reproduce

Failing UI test: org.mozilla.fenix.ui.NavigationToolbarTest#goBackTest

Test report: https://console.firebase.google.com/u/0/project/moz-fenix/testlab/histories/bh.66b7091e15d53d45/matrices/8229397304259493389/executions/bs.419e48010fba6b1a

Test report logcat

StackTrace:
java.lang.RuntimeException: Failed to call observer method FATAL EXCEPTION: DefaultDispatcher-worker-3 Process: org.mozilla.fenix.debug, PID: 12996 java.lang.RuntimeException: Failed to call observer method at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:226) at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeMethodsForEvent(ClassesInfoCache.java:194) at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeCallbacks(ClassesInfoCache.java:185) at androidx.lifecycle.ReflectiveGenericLifecycleObserver.onStateChanged(ReflectiveGenericLifecycleObserver.java:37) at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:361) at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:300) at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:339) at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:196) at mozilla.components.lib.state.ext.StoreExtensionsKt.flow(StoreExtensions.kt:155) at mozilla.components.lib.state.ext.FragmentKt.consumeFlow(Fragment.kt:94) at mozilla.components.lib.state.ext.FragmentKt.consumeFlow$default(Fragment.kt:84) at org.mozilla.fenix.browser.BaseBrowserFragment.observeTabSource$app_debug(BaseBrowserFragment.kt:894) at org.mozilla.fenix.browser.BaseBrowserFragment$onViewCreated$1.invokeSuspend(BaseBrowserFragment.kt:235) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) Caused by: java.lang.IllegalThreadStateException: Must have a Handler at org.mozilla.geckoview.GeckoResult.then(GeckoResult.java:476) at org.mozilla.geckoview.GeckoResult.then(GeckoResult.java:366) at org.mozilla.geckoview.WebExtensionController.ensureBuiltIn(WebExtensionController.java:593) at mozilla.components.browser.engine.gecko.GeckoEngine.installWebExtension(GeckoEngine.kt:211) at mozilla.components.support.webextensions.WebExtensionController.install(WebExtensionController.kt:54) at mozilla.components.support.webextensions.WebExtensionController.install$default(WebExtensionController.kt:50) at mozilla.components.feature.accounts.FxaWebChannelFeature.start(FxaWebChannelFeature.kt:81) at mozilla.components.support.base.feature.ViewBoundFeatureWrapper.start$support_base_release(ViewBoundFeatureWrapper.kt:160) at mozilla.components.support.base.feature.LifecycleBinding.start(ViewBoundFeatureWrapper.kt:196) at java.lang.reflect.Method.invoke(Native Method) at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:216) ... 18 more

Expected behavior

Actual behavior

Device information

  • Android device: Pixel 2, API 28, virtual device
  • Fenix version: Debug 12/15

┆Issue is synchronized with this Jira Task

@sv-ohorvath sv-ohorvath added 🐞 bug Crashes, Something isn't working, .. b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info eng:bug-auto-found Bug found via automated tests labels Dec 15, 2020
@github-actions github-actions bot added the needs:triage Issue needs triage label Dec 15, 2020
@csadilek
Copy link
Contributor

This seems to be happening (relatively low volume) only for the FxA web extension. We should only be calling feature.start on the main thread so the gecko result should have a handler. Needs investigation.

https://sentry.prod.mozaws.net/operations/firefox-nightly/issues/10160052/

@csadilek
Copy link
Contributor

This looks to be a regression of f823a5d which sets up a consumeFlow call on an IO thread. Let's fix this before it hits beta.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info 🐞 bug Crashes, Something isn't working, .. eng:bug-auto-found Bug found via automated tests Feature:Accounts Feature:WebExtensions
Projects
No open projects
Development

No branches or pull requests

2 participants