Shopify / android-testify

Add screenshots to your Android tests
https://testify.dev
MIT License
231 stars 23 forks source link

ParallelPixelProcessor.kt:90 - java.lang.IndexOutOfBoundsException: index=315250 out of bounds (limit=315250) #215

Closed DanielJette closed 3 years ago

DanielJette commented 3 years ago

Describe the bug

Crash in the ParallelPixelProcessor when using setScreenshotViewProvider and PixelCopyCapture together.

This issue relates to:

To Reproduce

    @ScreenshotInstrumentation
    @Test
    fun default() {
        TestifyFeatures.PixelCopyCapture.setEnabled(true)
        screenshotTestRule
            .setScreenshotViewProvider {
                it.findViewById(R.id.map)
            }
            .assertSame()
    }

Expected behavior

Should not crash

Desktop (please complete the following information):

Target Android Device (please complete the following information):

Additional context

java.lang.IndexOutOfBoundsException: index=315250 out of bounds (limit=315250)
    at java.nio.Buffer.checkIndex(Buffer.java:556)
    at java.nio.HeapIntBuffer.get(HeapIntBuffer.java:114)
    at com.shopify.testify.internal.processor.ParallelPixelProcessor$transform$1.invoke(ParallelPixelProcessor.kt:90)
    at com.shopify.testify.internal.processor.ParallelPixelProcessor$transform$1.invoke(ParallelPixelProcessor.kt:13)
    at com.shopify.testify.internal.processor.ParallelPixelProcessor$runBlockingInChunks$1$1$invokeSuspend$$inlined$map$lambda$1.invokeSuspend(ParallelPixelProcessor.kt:58)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:919)