mozilla-mobile / android-components

⚠️ This project moved to a new repository. It is now developed and maintained at: https://github.com/mozilla-mobile/firefox-android
https://github.com/mozilla-mobile/firefox-android
Mozilla Public License 2.0
2.02k stars 473 forks source link

Intermittent unit test failure - mozilla.components.support.webextensions.WebExtensionSupportTest - reacts to new tab being opened by adding tab to store #12201

Closed Archaeopteryx closed 2 years ago

Archaeopteryx commented 2 years ago

Firebase Test Run:

https://treeherder.mozilla.org/logviewer?job_id=378628732&repo=android-components

Stacktrace:

  TEST: reacts to new tab being opened by adding tab to store
  FAILURE

java.lang.IllegalStateException: Dispatchers.Main is used concurrently with setting it
    at kotlinx.coroutines.test.internal.TestMainDispatcher$NonConcurrentlyModifiable.concurrentRW(TestMainDispatcher.kt:70)
    at kotlinx.coroutines.test.internal.TestMainDispatcher$NonConcurrentlyModifiable.setValue(TestMainDispatcher.kt:86)
    at kotlinx.coroutines.test.internal.TestMainDispatcher.resetDispatcher(TestMainDispatcher.kt:40)
    at kotlinx.coroutines.test.TestDispatchers.resetMain(TestDispatchers.kt:37)
    at mozilla.components.support.test.rule.MainCoroutineRule.finished(MainCoroutineRule.kt:54)
    at org.junit.rules.TestWatcher.finishedQuietly(TestWatcher.java:117)
    at org.junit.rules.TestWatcher.access$400(TestWatcher.java:46)
    at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:64)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:591)
    at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:274)
    at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:88)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)

Build:

https://github.com/mozilla-mobile/android-components/commit/2f8261343b54eadb68b8ced57ff19636e42e9bfd

┆Issue is synchronized with this Jira Task

csadilek commented 2 years ago

Dupe / same cause: https://github.com/mozilla-mobile/android-components/issues/12230.