thunderbird / thunderbird/thunderbird-android

Tests fail in Windows environment

Open
#11,531 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: developer experience type: maintenance
Dominant language
Kotlin
Stars
14k
Forks
2.8k
Avg merge
3d 3h
Merged PRs (30d)
57

Description

Checklist
  • I have used the search function to see if someone else has already submitted the same bug report.
  • I will describe the problem with as much detail as possible.
App

Thunderbird for Android

App version

Up to date clone of main branch (no changes)

Where did you get the app from?

None

Android version

Android Sdk 17.0

Device model

HP OmniBook, Windows 11, Java 21 and 25

Steps to reproduce
  1. Follow Developer Guide for environment setup exactly
  2. Run './gradlew test' or './gradlew.bat test' or './gradlew check' or './gradlew.bat check'
Expected behavior

Tests run with no fails

Actual behavior

AttachmentControllerTest fails, this is the output:

Failed to find configured root that contains C:\Users\lf\AppData\Local\Temp\robolectric-AttachmentControllerTest_viewing_attachment_should_an_appropriate_activity_with_ACTION_intent5948247161533901125\com.fsck.k9.ui.test-dataDir\cache\temp\b833694dc1c43716c74048f226b496eff6c230fd
java.lang.IllegalArgumentException: Failed to find configured root that contains C:\Users\lf\AppData\Local\Temp\robolectric-AttachmentControllerTest_viewing_attachment_should_an_appropriate_activity_with_ACTION_intent5948247161533901125\com.fsck.k9.ui.test-dataDir\cache\temp\b833694dc1c43716c74048f226b496eff6c230fd
	at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:911)
	at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:415)
	at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:443)
	at com.fsck.k9.provider.AttachmentTempFileProvider.createTempUriForContentUri(AttachmentTempFileProvider.java:54)
	at com.fsck.k9.ui.messageview.AttachmentController.getBestViewIntent(AttachmentController.kt:181)
	at com.fsck.k9.ui.messageview.AttachmentController.access$getBestViewIntent(AttachmentController.kt:30)
	at com.fsck.k9.ui.messageview.AttachmentController$viewLocalAttachment$intent$1.invokeSuspend(AttachmentController.kt:154)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWithInternal(DispatchedContinuation.kt:384)
	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:502)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at com.fsck.k9.ui.messageview.AttachmentController.viewLocalAttachment(AttachmentController.kt:154)
	at com.fsck.k9.ui.messageview.AttachmentController.access$viewLocalAttachment(AttachmentController.kt:30)
	at com.fsck.k9.ui.messageview.AttachmentController$viewAttachment$1.invokeSuspend(AttachmentController.kt:49)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.test.TestDispatcher.processEvent$kotlinx_coroutines_test(TestDispatcher.kt:24)
	at kotlinx.coroutines.test.TestCoroutineScheduler.tryRunNextTaskUnless$kotlinx_coroutines_test(TestCoroutineScheduler.kt:98)
	at kotlinx.coroutines.test.TestCoroutineScheduler.advanceUntilIdleOr$kotlinx_coroutines_test(TestCoroutineScheduler.kt:117)
	at kotlinx.coroutines.test.TestCoroutineScheduler.advanceUntilIdle(TestCoroutineScheduler.kt:110)
	at kotlinx.coroutines.test.TestScopeKt.advanceUntilIdle(TestScope.kt:82)
	at com.fsck.k9.ui.messageview.AttachmentControllerTest$viewing attachment should an appropriate activity with ACTION intent$1.invokeSuspend(AttachmentControllerTest.kt:188)
	at com.fsck.k9.ui.messageview.AttachmentControllerTest$viewing attachment should an appropriate activity with ACTION intent$1.invoke(AttachmentControllerTest.kt)
	at com.fsck.k9.ui.messageview.AttachmentControllerTest$viewing attachment should an appropriate activity with ACTION intent$1.invoke(AttachmentControllerTest.kt)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTest$2$1$1.invokeSuspend(TestBuilders.kt:317)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.test.TestDispatcher.processEvent$kotlinx_coroutines_test(TestDispatcher.kt:24)
	at kotlinx.coroutines.test.TestCoroutineScheduler.tryRunNextTaskUnless$kotlinx_coroutines_test(TestCoroutineScheduler.kt:98)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTest$2$1$workRunner$1.invokeSuspend(TestBuilders.kt:326)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:256)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:54)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlockingImpl(Builders.kt:30)
	at kotlinx.coroutines.BuildersKt.runBlockingImpl(Unknown Source)
	at kotlinx.coroutines.BuildersKt__Builders_concurrentKt.runBlockingK(Builders.concurrent.kt:172)
	at kotlinx.coroutines.BuildersKt.runBlockingK(Unknown Source)
	at kotlinx.coroutines.BuildersKt__Builders_concurrentKt.runBlockingK$default(Builders.concurrent.kt:157)
	at kotlinx.coroutines.BuildersKt.runBlockingK$default(Unknown Source)
	at kotlinx.coroutines.test.TestBuildersJvmKt.createTestResult(TestBuildersJvm.kt:10)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:309)
	at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:1)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:167)
	at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:1)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0$default(TestBuilders.kt:159)
	at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0$default(TestBuilders.kt:1)
	at com.fsck.k9.ui.messageview.AttachmentControllerTest.viewing attachment should an appropriate activity with ACTION intent(AttachmentControllerTest.kt:156)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:542)
	at org.robolectric.internal.SandboxTestRunner.lambda$executeInSandbox$4(SandboxTestRunner.java:429)
	at org.robolectric.internal.SandboxTestRunner.runInSandbox(SandboxTestRunner.java:455)
	at org.robolectric.internal.SandboxTestRunner.executeInSandbox(SandboxTestRunner.java:420)
	at org.robolectric.internal.SandboxTestRunner$5.evaluate(SandboxTestRunner.java:405)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.robolectric.internal.SandboxTestRunner.access$000(SandboxTestRunner.java:64)
	at org.robolectric.internal.SandboxTestRunner$4.evaluate(SandboxTestRunner.java:294)
	at org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:260)
	at org.robolectric.internal.SandboxTestRunner$3.lambda$evaluate$0(SandboxTestRunner.java:280)
	at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThreadWithClassLoader$1(Sandbox.java:112)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)
	Suppressed: org.opentest4j.AssertionFailedError: expected to not be null
		at com.fsck.k9.ui.messageview.AttachmentControllerTest$viewing attachment should an appropriate activity with ACTION intent$1.invokeSuspend(AttachmentControllerTest.kt:192)
		... 52 more


Failed to find configured root that contains C:\Users\lf\AppData\Local\Temp\robolectric-AttachmentControllerTest_attachment_content_is_set_available_if_download_is_success13273582510758411215\com.fsck.k9.ui.test-dataDir\cache\temp\b833694dc1c43716c74048f226b496eff6c230fd
java.lang.IllegalArgumentException: Failed to find configured root that contains C:\Users\lf\AppData\Local\Temp\robolectric-AttachmentControllerTest_attachment_content_is_set_available_if_download_is_success13273582510758411215\com.fsck.k9.ui.test-dataDir\cache\temp\b833694dc1c43716c74048f226b496eff6c230fd
	at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:911)
	at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:415)
	at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:443)
	at com.fsck.k9.provider.AttachmentTempFileProvider.createTempUriForContentUri(AttachmentTempFileProvider.java:54)
	at com.fsck.k9.ui.messageview.AttachmentController.getBestViewIntent(AttachmentController.kt:181)
	at com.fsck.k9.ui.messageview.AttachmentController.access$getBestViewIntent(AttachmentController.kt:30)
	at com.fsck.k9.ui.messageview.AttachmentController$viewLocalAttachment$intent$1.invokeSuspend(AttachmentController.kt:154)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWithInternal(DispatchedContinuation.kt:384)
	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:502)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at com.fsck.k9.ui.messageview.AttachmentController.viewLocalAttachment(AttachmentController.kt:154)
	at com.fsck.k9.ui.messageview.AttachmentController.access$viewLocalAttachment(AttachmentController.kt:30)
	at com.fsck.k9.ui.messageview.AttachmentController$viewAttachment$1.invokeSuspend(AttachmentController.kt:46)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.test.TestDispatcher.processEvent$kotlinx_coroutines_test(TestDispatcher.kt:24)
	at kotlinx.coroutines.test.TestCoroutineScheduler.tryRunNextTaskUnless$kotlinx_coroutines_test(TestCoroutineScheduler.kt:98)
	at kotlinx.coroutines.test.TestCoroutineScheduler.advanceUntilIdleOr$kotlinx_coroutines_test(TestCoroutineScheduler.kt:117)
	at kotlinx.coroutines.test.TestCoroutineScheduler.advanceUntilIdle(TestCoroutineScheduler.kt:110)
	at kotlinx.coroutines.test.TestScopeKt.advanceUntilIdle(TestScope.kt:82)
	at com.fsck.k9.ui.messageview.AttachmentControllerTest$attachment content is set available if download is success$1.invokeSuspend(AttachmentControllerTest.kt:105)
	at com.fsck.k9.ui.messageview.AttachmentControllerTest$attachment content is set available if download is success$1.invoke(AttachmentControllerTest.kt)
	at com.fsck.k9.ui.messageview.AttachmentControllerTest$attachment content is set available if download is success$1.invoke(AttachmentControllerTest.kt)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTest$2$1$1.invokeSuspend(TestBuilders.kt:317)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.test.TestDispatcher.processEvent$kotlinx_coroutines_test(TestDispatcher.kt:24)
	at kotlinx.coroutines.test.TestCoroutineScheduler.tryRunNextTaskUnless$kotlinx_coroutines_test(TestCoroutineScheduler.kt:98)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTest$2$1$workRunner$1.invokeSuspend(TestBuilders.kt:326)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:256)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:54)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlockingImpl(Builders.kt:30)
	at kotlinx.coroutines.BuildersKt.runBlockingImpl(Unknown Source)
	at kotlinx.coroutines.BuildersKt__Builders_concurrentKt.runBlockingK(Builders.concurrent.kt:172)
	at kotlinx.coroutines.BuildersKt.runBlockingK(Unknown Source)
	at kotlinx.coroutines.BuildersKt__Builders_concurrentKt.runBlockingK$default(Builders.concurrent.kt:157)
	at kotlinx.coroutines.BuildersKt.runBlockingK$default(Unknown Source)
	at kotlinx.coroutines.test.TestBuildersJvmKt.createTestResult(TestBuildersJvm.kt:10)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:309)
	at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:1)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:167)
	at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:1)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0$default(TestBuilders.kt:159)
	at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0$default(TestBuilders.kt:1)
	at com.fsck.k9.ui.messageview.AttachmentControllerTest.attachment content is set available if download is success(AttachmentControllerTest.kt:77)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:542)
	at org.robolectric.internal.SandboxTestRunner.lambda$executeInSandbox$4(SandboxTestRunner.java:429)
	at org.robolectric.internal.SandboxTestRunner.runInSandbox(SandboxTestRunner.java:455)
	at org.robolectric.internal.SandboxTestRunner.executeInSandbox(SandboxTestRunner.java:420)
	at org.robolectric.internal.SandboxTestRunner$5.evaluate(SandboxTestRunner.java:405)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.robolectric.internal.SandboxTestRunner.access$000(SandboxTestRunner.java:64)
	at org.robolectric.internal.SandboxTestRunner$4.evaluate(SandboxTestRunner.java:294)
	at org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:260)
	at org.robolectric.internal.SandboxTestRunner$3.lambda$evaluate$0(SandboxTestRunner.java:280)
	at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThreadWithClassLoader$1(Sandbox.java:112)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with ./gradlew.bat test and inspect AttachmentControllerTest.kt, especially the cases reported at lines 105 and 156. Trace the failing temporary-file URI handling through AttachmentTempFileProvider.kt and compare the Windows path behavior with the expected FileProvider configuration. Done means the affected tests and the Windows test/check commands pass without the configured-root error.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
operating-systems, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.