Skip to content

Windows test DeckPickerTest > [1] > ContextMenu creates deck shortcut when selecting CREATE_SHORTCUT[1] has become flaky #19468

@mikehardy

Description

@mikehardy

Windows test DeckPickerTest > [1] > ContextMenu creates deck shortcut when selecting CREATE_SHORTCUT[1] has become flaky

unrelated to this PR - noting for posterity

DeckPickerTest > [1] > ContextMenu creates deck shortcut when selecting CREATE_SHORTCUT[1] FAILED
    java.lang.IllegalStateException: throwOnShowError: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. Expected: SDK 35 Main Thread @kotlinx.coroutines.test runner#3416 Calling: DefaultDispatcher-worker-4 @coroutine#3438
        at com.ichi2.anki.CrashReportData$Companion.throwIfDialogUnusable(CoroutineHelpers.kt:719)
        at com.ichi2.anki.CoroutineHelpersKt.showError(CoroutineHelpers.kt:259)
        at com.ichi2.anki.CoroutineHelpersKt.showError(CoroutineHelpers.kt:607)
        at com.ichi2.anki.CoroutineHelpersKt.showError$default(CoroutineHelpers.kt:604)
        at com.ichi2.anki.CoroutineHelpersKt.runCatching(CoroutineHelpers.kt:203)
        at com.ichi2.anki.CoroutineHelpersKt$runCatching$1.invokeSuspend(CoroutineHelpers.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:98)
        at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:65)
        at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:243)
        at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:147)
        at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:470)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$kotlinx_coroutines_core(CancellableContinuationImpl.kt:504)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$kotlinx_coroutines_core$default(CancellableContinuationImpl.kt:493)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:359)
        at kotlinx.coroutines.ResumeOnCompletion.invoke(JobSupport.kt:1541)
        at kotlinx.coroutines.JobSupport.notifyCompletion(JobSupport.kt:1625)
        at kotlinx.coroutines.JobSupport.completeStateFinalization(JobSupport.kt:316)
        at kotlinx.coroutines.JobSupport.finalizeFinishingState(JobSupport.kt:233)
        at kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath(JobSupport.kt:946)
        at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:894)
        at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:859)
        at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:99)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:47)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
        at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:124)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:820)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)

        Caused by:
        android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. Expected: SDK 35 Main Thread @kotlinx.coroutines.test runner#3416 Calling: DefaultDispatcher-worker-4 @coroutine#3438
            at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:11023)
            at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:2473)
            at android.view.View.requestLayout(View.java:28020)
            at org.robolectric.shadows.ShadowView$ViewReflector$$Reflector51.requestLayout(Unknown Source)
            at org.robolectric.shadows.ShadowView.requestLayout(ShadowView.java:268)
            at android.view.View.requestLayout(View.java)
            at android.view.View.setLayoutParams(View.java:20530)
            at android.view.WindowManagerGlobal.updateViewLayout(WindowManagerGlobal.java:464)
            at android.view.WindowManagerImpl.updateViewLayout(WindowManagerImpl.java:165)
            at android.app.Activity.onWindowAttributesChanged(Activity.java:4364)
            at androidx.appcompat.view.WindowCallbackWrapper.onWindowAttributesChanged(WindowCallbackWrapper.java:114)
            at android.view.Window.dispatchWindowAttributesChanged(Window.java:1323)
            at com.android.internal.policy.PhoneWindow.dispatchWindowAttributesChanged(PhoneWindow.java:3197)
            at android.view.Window.setFlags(Window.java:1309)
            at org.robolectric.shadows.ShadowWindow$WindowReflector$$Reflector62.setFlags(Unknown Source)
            at org.robolectric.shadows.ShadowWindow.setFlags(ShadowWindow.java:54)
            at android.view.Window.setFlags(Window.java)
            at android.view.Window.clearFlags(Window.java:1283)
            at com.ichi2.anki.CoroutineHelpersKt$withProgressDialog$2.invokeSuspend(CoroutineHelpers.kt:473)
            at app//kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)

Originally posted by @mikehardy in #19466 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions