Skip to content

Commit 07af15e

Browse files
romtsnclaude
andcommitted
test(replay): Return CompletedFuture from inlineExecutor to match ReplayExecutorService
inlineExecutor() returned null from submit, which under the executor's contract means "rejected" — making capture()'s null-fallback finishFrame run on top of the mask task's own finally, a double-release production never hits on the inline path. Return CompletedFuture so the fixture matches the real inline semantics. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 52011c1 commit 07af15e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

sentry-android-replay/src/test/java/io/sentry/android/replay/screenshot/PixelCopyStrategyTest.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import io.sentry.SentryOptions
2525
import io.sentry.android.replay.ExecutorProvider
2626
import io.sentry.android.replay.ScreenshotRecorderCallback
2727
import io.sentry.android.replay.ScreenshotRecorderConfig
28+
import io.sentry.android.replay.util.CompletedFuture
2829
import io.sentry.android.replay.util.DebugOverlayDrawable
2930
import io.sentry.android.replay.util.MainLooperHandler
3031
import io.sentry.android.replay.util.ReplayRunnable
@@ -87,7 +88,10 @@ class PixelCopyStrategyTest {
8788
return mock {
8889
doAnswer {
8990
(it.arguments[0] as Runnable).run()
90-
null // submit(Runnable) returns Future<?>; returning Unit breaks the cast
91+
// Mirror ReplayExecutorService's inline contract: a completed future, not null. Null
92+
// means "rejected" and would make capture() run its null-fallback finishFrame on top of
93+
// the task's own, a double-release production never does on the inline path.
94+
CompletedFuture
9195
}
9296
.whenever(mock)
9397
.submit(any<Runnable>())

0 commit comments

Comments
 (0)