TapDaemonProcess

Explicit daemon lifecycle from a test process: tap start and tap stop through the tap executable (DaemonDiscovery.findBinary). The executable is the only thing that spawns a server; it picks the port, detaches the process and waits for Info to answer.

Types

Link copied to clipboard
data class StartResult(val address: String, val started: Boolean)

address of the server and whether this call started it (false = it was already running).

Functions

Link copied to clipboard
suspend fun start(binary: String? = null, stateDir: Path = DaemonDiscovery.stateDir(), options: List<String> = emptyList(), timeout: Duration = 45.seconds): TapDaemonProcess.StartResult

Starts a server in the background unless one is already running in stateDir. Extra tap serve options (--adb PATH) go in options. Runs the executable on Dispatchers.IO with a bounded wait; the calling coroutine stays cancellable while waiting on the process exit (cancellation destroys the process promptly).

Link copied to clipboard
suspend fun stop(binary: String? = null, stateDir: Path = DaemonDiscovery.stateDir(), timeout: Duration = 30.seconds)

Stops the server recorded in stateDir; a no-op when none is running.