Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import java.util.Collections
import java.util.concurrent.CountDownLatch
import javax.crypto.SecretKey
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.runBlocking
Expand Down Expand Up @@ -46,7 +47,10 @@ class AndroidRuntimeLifecycleTest {

val signIn = async(Dispatchers.Default) { runtime.signIn(scope, "device-key") }
keyStarted.await()
val signOut = async(Dispatchers.Default) { runtime.signOut(scope, "device-key") }
val signOut = async(
context = Dispatchers.Default,
start = CoroutineStart.UNDISPATCHED,
) { runtime.signOut(scope, "device-key") }

assertNull(withTimeoutOrNull(200) { revokeCalled.await() })
assertEquals(listOf("key-create"), events.toList())
Expand Down
7 changes: 7 additions & 0 deletions docs/operations/code-review-14-disposition.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ was requested). It identified one valid lifecycle race: sign-in and sign-out cou
between device-key initialization and revocation. `AndroidRuntime` now serializes the complete
sign-in/sign-out lifecycle per `AccountWorkspaceScope`, and a blocking JVM test proves sign-out
cannot revoke, cancel, or delete the key until sign-in has completed.

## Automatic incremental review after PR #17 synchronization

GitHub automatically refreshed the existing review after PR #17 merged into `dev` (no new review
was requested). It identified a valid test determinism issue: the lifecycle test now starts
sign-out with `CoroutineStart.UNDISPATCHED` after key creation has blocked, guaranteeing that the
test actually contends on the per-scope mutex before releasing sign-in.
Loading