From 2d83cc4e85860009452030772cc45de64e02204a Mon Sep 17 00:00:00 2001 From: Stephen Edwards Date: Tue, 12 Aug 2025 09:27:32 -0400 Subject: [PATCH] Follow-up cleanups from Runtime Tracing Upstream --- workflow-runtime/api/workflow-runtime.api | 4 +-- .../com/squareup/workflow1/RenderWorkflow.kt | 10 +++--- .../squareup/workflow1/WorkflowInterceptor.kt | 2 +- .../tracing/papa/WorkflowPapaTracer.kt | 21 ++---------- .../tracing/papa/WorkflowPapaTracerTest.kt | 6 ++-- .../papa/WorkflowTracingIntegrationTest.kt | 8 ++--- workflow-tracing/api/workflow-tracing.api | 9 ++--- .../workflow1/tracing/ConfigSnapshot.kt | 34 +++++++++++++++---- .../workflow1/tracing/SafeTraceInterface.kt | 16 ++++----- .../tracing/WorkflowRenderPassTracker.kt | 26 +++++++------- .../tracing/WorkflowRuntimeLoopListener.kt | 2 +- .../tracing/WorkflowRuntimeMonitor.kt | 6 ++-- .../tracing/WorkflowRuntimeMonitorTest.kt | 24 ++++++------- 13 files changed, 84 insertions(+), 84 deletions(-) diff --git a/workflow-runtime/api/workflow-runtime.api b/workflow-runtime/api/workflow-runtime.api index 137088108..4498c7384 100644 --- a/workflow-runtime/api/workflow-runtime.api +++ b/workflow-runtime/api/workflow-runtime.api @@ -108,8 +108,8 @@ public final class com/squareup/workflow1/WorkflowInterceptor$RenderingProduced public fun toString ()Ljava/lang/String; } -public final class com/squareup/workflow1/WorkflowInterceptor$RuntimeLoopTick : com/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate { - public static final field INSTANCE Lcom/squareup/workflow1/WorkflowInterceptor$RuntimeLoopTick; +public final class com/squareup/workflow1/WorkflowInterceptor$RuntimeSettled : com/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate { + public static final field INSTANCE Lcom/squareup/workflow1/WorkflowInterceptor$RuntimeSettled; public fun equals (Ljava/lang/Object;)Z public fun hashCode ()I public fun toString ()Ljava/lang/String; diff --git a/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/RenderWorkflow.kt b/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/RenderWorkflow.kt index ceeb0e622..deb090ca2 100644 --- a/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/RenderWorkflow.kt +++ b/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/RenderWorkflow.kt @@ -6,7 +6,7 @@ import com.squareup.workflow1.RuntimeConfigOptions.RENDER_ONLY_WHEN_STATE_CHANGE import com.squareup.workflow1.WorkflowInterceptor.RenderPassSkipped import com.squareup.workflow1.WorkflowInterceptor.RenderingConflated import com.squareup.workflow1.WorkflowInterceptor.RenderingProduced -import com.squareup.workflow1.WorkflowInterceptor.RuntimeLoopTick +import com.squareup.workflow1.WorkflowInterceptor.RuntimeSettled import com.squareup.workflow1.internal.WorkStealingDispatcher import com.squareup.workflow1.internal.WorkflowRunner import com.squareup.workflow1.internal.chained @@ -176,7 +176,7 @@ public fun renderWorkflowIn( try { runner.nextRendering().also { chainedInterceptor.onRuntimeUpdate(RenderingProduced) - chainedInterceptor.onRuntimeUpdate(RuntimeLoopTick) + chainedInterceptor.onRuntimeUpdate(RuntimeSettled) } } catch (e: Throwable) { // If any part of the workflow runtime fails, the scope should be cancelled. We're not in a @@ -239,7 +239,7 @@ public fun renderWorkflowIn( if (shouldShortCircuitForUnchangedState(actionResult)) { chainedInterceptor.onRuntimeUpdate(RenderPassSkipped) - chainedInterceptor.onRuntimeUpdate(RuntimeLoopTick) + chainedInterceptor.onRuntimeUpdate(RuntimeSettled) sendOutput(actionResult, onOutput) continue@outer } @@ -295,7 +295,7 @@ public fun renderWorkflowIn( // in case it is the last update! break@conflate } - chainedInterceptor.onRuntimeUpdate(RuntimeLoopTick) + chainedInterceptor.onRuntimeUpdate(RuntimeSettled) sendOutput(actionResult, onOutput) continue@outer } @@ -310,7 +310,7 @@ public fun renderWorkflowIn( renderingsAndSnapshots.value = nextRenderAndSnapshot.also { chainedInterceptor.onRuntimeUpdate(RenderingProduced) } - chainedInterceptor.onRuntimeUpdate(RuntimeLoopTick) + chainedInterceptor.onRuntimeUpdate(RuntimeSettled) // Emit the Output sendOutput(actionResult, onOutput) diff --git a/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/WorkflowInterceptor.kt b/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/WorkflowInterceptor.kt index c6c168578..728fb5aae 100644 --- a/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/WorkflowInterceptor.kt +++ b/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/WorkflowInterceptor.kt @@ -188,7 +188,7 @@ public interface WorkflowInterceptor { * The runtime has finished its work and is stable again - either skipping rendering because * of no change ([RenderPassSkipped]), or having passed a new rendering ([RenderingProduced]). */ - public data object RuntimeLoopTick : RuntimeUpdate + public data object RuntimeSettled : RuntimeUpdate /** * Information about the session of a workflow in the runtime that a [WorkflowInterceptor] method diff --git a/workflow-tracing-papa/src/main/java/com/squareup/workflow1/tracing/papa/WorkflowPapaTracer.kt b/workflow-tracing-papa/src/main/java/com/squareup/workflow1/tracing/papa/WorkflowPapaTracer.kt index eb3877cec..d317df659 100644 --- a/workflow-tracing-papa/src/main/java/com/squareup/workflow1/tracing/papa/WorkflowPapaTracer.kt +++ b/workflow-tracing-papa/src/main/java/com/squareup/workflow1/tracing/papa/WorkflowPapaTracer.kt @@ -10,7 +10,7 @@ import com.squareup.workflow1.Workflow import com.squareup.workflow1.WorkflowAction import com.squareup.workflow1.WorkflowInterceptor.RenderContextInterceptor import com.squareup.workflow1.WorkflowInterceptor.RenderPassSkipped -import com.squareup.workflow1.WorkflowInterceptor.RuntimeLoopTick +import com.squareup.workflow1.WorkflowInterceptor.RuntimeSettled import com.squareup.workflow1.WorkflowInterceptor.RuntimeUpdate import com.squareup.workflow1.WorkflowInterceptor.WorkflowSession import com.squareup.workflow1.applyTo @@ -154,26 +154,11 @@ class WorkflowPapaTracer( // Skipping, end the section started when renderIncomingCause was set. safeTrace.endSection() } - if (runtimeUpdate == RuntimeLoopTick) { + if (runtimeUpdate == RuntimeSettled) { // Build and add the summary! val summary = buildString { append("SUM${renderPassNumber()} ") - append("Config:") - if (configSnapshot.shortCircuitConfig) { - append("ROWSC, ") - } - if (configSnapshot.csrConfig) { - append("CSR, ") - } - if (configSnapshot.ptrConfig) { - append("PTR, ") - } - if (!configSnapshot.shortCircuitConfig && - !configSnapshot.csrConfig && - !configSnapshot.ptrConfig - ) { - append("Base, ") - } + append(configSnapshot.shortConfigAsString) append("StateChange:") if (currentActionHandlingChangedState) { append("Y, ") diff --git a/workflow-tracing-papa/src/test/java/com/squareup/workflow1/tracing/papa/WorkflowPapaTracerTest.kt b/workflow-tracing-papa/src/test/java/com/squareup/workflow1/tracing/papa/WorkflowPapaTracerTest.kt index e0fdb5cc6..8ddfd0780 100644 --- a/workflow-tracing-papa/src/test/java/com/squareup/workflow1/tracing/papa/WorkflowPapaTracerTest.kt +++ b/workflow-tracing-papa/src/test/java/com/squareup/workflow1/tracing/papa/WorkflowPapaTracerTest.kt @@ -7,7 +7,7 @@ import com.squareup.workflow1.Snapshot import com.squareup.workflow1.StatefulWorkflow import com.squareup.workflow1.TreeSnapshot import com.squareup.workflow1.WorkflowInterceptor.RenderPassSkipped -import com.squareup.workflow1.WorkflowInterceptor.RuntimeLoopTick +import com.squareup.workflow1.WorkflowInterceptor.RuntimeSettled import com.squareup.workflow1.WorkflowInterceptor.WorkflowSession import com.squareup.workflow1.identifier import com.squareup.workflow1.tracing.ConfigSnapshot @@ -175,8 +175,8 @@ internal class WorkflowPapaTracerTest { // Should not throw for RenderPassSkipped papaTracer.onRuntimeUpdateEnhanced(RenderPassSkipped, false, configSnapshot) - // Should not throw for RuntimeLoopTick - papaTracer.onRuntimeUpdateEnhanced(RuntimeLoopTick, true, configSnapshot) + // Should not throw for RuntimeLoopSettled + papaTracer.onRuntimeUpdateEnhanced(RuntimeSettled, true, configSnapshot) } @Test diff --git a/workflow-tracing-papa/src/test/java/com/squareup/workflow1/tracing/papa/WorkflowTracingIntegrationTest.kt b/workflow-tracing-papa/src/test/java/com/squareup/workflow1/tracing/papa/WorkflowTracingIntegrationTest.kt index daf73084a..7663cc716 100644 --- a/workflow-tracing-papa/src/test/java/com/squareup/workflow1/tracing/papa/WorkflowTracingIntegrationTest.kt +++ b/workflow-tracing-papa/src/test/java/com/squareup/workflow1/tracing/papa/WorkflowTracingIntegrationTest.kt @@ -330,7 +330,7 @@ internal class WorkflowTracingIntegrationTest { runtimeLoopMutex.lock() // Verify that runtime loop listener was called - assertTrue(runtimeListener.onRuntimeLoopTickCalled) + assertTrue(runtimeListener.onRuntimeLoopSettledCalled) assertNotNull(runtimeListener.runtimeUpdatesReceived) val traceCalls = fakeTrace.traceCalls @@ -505,15 +505,15 @@ internal class WorkflowTracingIntegrationTest { private class TestWorkflowRuntimeLoopListener( val runtimeLoopMutex: Mutex, ) : WorkflowRuntimeLoopListener { - var onRuntimeLoopTickCalled = false + var onRuntimeLoopSettledCalled = false var runtimeUpdatesReceived: RuntimeUpdates? = null - override fun onRuntimeLoopTick( + override fun onRuntimeLoopSettled( configSnapshot: ConfigSnapshot, runtimeUpdates: RuntimeUpdates ) { runtimeLoopMutex.unlock() - onRuntimeLoopTickCalled = true + onRuntimeLoopSettledCalled = true runtimeUpdatesReceived = runtimeUpdates } } diff --git a/workflow-tracing/api/workflow-tracing.api b/workflow-tracing/api/workflow-tracing.api index 6bbd32b02..835a16551 100644 --- a/workflow-tracing/api/workflow-tracing.api +++ b/workflow-tracing/api/workflow-tracing.api @@ -27,12 +27,7 @@ public final class com/squareup/workflow1/tracing/ChainedWorkflowRuntimeTracerKt public final class com/squareup/workflow1/tracing/ConfigSnapshot { public fun (Ljava/util/Set;)V public final fun getConfigAsString ()Ljava/lang/String; - public final fun getCsrConfig ()Z - public final fun getDeaConfig ()Z - public final fun getPtrConfig ()Z - public final fun getSehConfig ()Z - public final fun getShortCircuitConfig ()Z - public final fun getWsdConfig ()Z + public final fun getShortConfigAsString ()Ljava/lang/String; } public abstract interface class com/squareup/workflow1/tracing/Loggable { @@ -148,7 +143,7 @@ public abstract interface class com/squareup/workflow1/tracing/WorkflowRenderPas } public abstract interface class com/squareup/workflow1/tracing/WorkflowRuntimeLoopListener { - public abstract fun onRuntimeLoopTick (Lcom/squareup/workflow1/tracing/ConfigSnapshot;Lcom/squareup/workflow1/tracing/RuntimeUpdates;)V + public abstract fun onRuntimeLoopSettled (Lcom/squareup/workflow1/tracing/ConfigSnapshot;Lcom/squareup/workflow1/tracing/RuntimeUpdates;)V } public final class com/squareup/workflow1/tracing/WorkflowRuntimeMonitor : com/squareup/workflow1/WorkflowInterceptor, com/squareup/workflow1/tracing/RuntimeTraceContext { diff --git a/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/ConfigSnapshot.kt b/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/ConfigSnapshot.kt index 9ec7f4f9c..3d1c0ea71 100644 --- a/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/ConfigSnapshot.kt +++ b/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/ConfigSnapshot.kt @@ -14,12 +14,32 @@ import com.squareup.workflow1.WorkflowExperimentalRuntime */ @OptIn(WorkflowExperimentalRuntime::class) public class ConfigSnapshot(config: RuntimeConfig) { - val shortCircuitConfig = config.contains(RENDER_ONLY_WHEN_STATE_CHANGES) - val csrConfig = config.contains(CONFLATE_STALE_RENDERINGS) - val ptrConfig = config.contains(PARTIAL_TREE_RENDERING) - val deaConfig = config.contains(DRAIN_EXCLUSIVE_ACTIONS) - val sehConfig = config.contains(STABLE_EVENT_HANDLERS) - val wsdConfig = config.contains(WORK_STEALING_DISPATCHER) + public val configAsString: String = config.toString() - val configAsString = config.toString() + public val shortConfigAsString: String by lazy { + buildString { + append("Config:") + if (config.contains(RENDER_ONLY_WHEN_STATE_CHANGES)) { + append("ROWSC, ") + } + if (config.contains(CONFLATE_STALE_RENDERINGS)) { + append("CSR, ") + } + if (config.contains(PARTIAL_TREE_RENDERING)) { + append("PTR, ") + } + if (config.contains(DRAIN_EXCLUSIVE_ACTIONS)) { + append("DEA, ") + } + if (config.contains(STABLE_EVENT_HANDLERS)) { + append("SEH, ") + } + if (config.contains(WORK_STEALING_DISPATCHER)) { + append("WSD, ") + } + if (config.isEmpty()) { + append("Base, ") + } + } + } } diff --git a/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/SafeTraceInterface.kt b/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/SafeTraceInterface.kt index e72f8a75a..b381da9bc 100644 --- a/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/SafeTraceInterface.kt +++ b/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/SafeTraceInterface.kt @@ -3,21 +3,21 @@ package com.squareup.workflow1.tracing /** * Interface abstracting tracing functionality to allow for testing with fake implementations. */ -interface SafeTraceInterface { - val isTraceable: Boolean - val isCurrentlyTracing: Boolean +public interface SafeTraceInterface { + public val isTraceable: Boolean + public val isCurrentlyTracing: Boolean - fun beginSection(label: String) - fun endSection() - fun beginAsyncSection( + public fun beginSection(label: String) + public fun endSection() + public fun beginAsyncSection( name: String, cookie: Int ) - fun endAsyncSection( + public fun endAsyncSection( name: String, cookie: Int ) - fun logSection(info: String) + public fun logSection(info: String) } diff --git a/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/WorkflowRenderPassTracker.kt b/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/WorkflowRenderPassTracker.kt index 008e5e52c..a8889f879 100644 --- a/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/WorkflowRenderPassTracker.kt +++ b/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/WorkflowRenderPassTracker.kt @@ -6,21 +6,21 @@ import kotlin.time.Duration * Can be passed to a [WorkflowRuntimeMonitor] to track each render pass as it happens, and the * cause of it. */ -fun interface WorkflowRenderPassTracker { +public fun interface WorkflowRenderPassTracker { /** * Records that a render pass happened. */ - fun recordRenderPass(renderPass: RenderPassInfo) + public fun recordRenderPass(renderPass: RenderPassInfo) } /** * A bundle of little info about a render pass. */ -class RenderPassInfo( - val runnerName: String, - val renderCause: RenderCause, - val durationUptime: Duration +public class RenderPassInfo( + public val runnerName: String, + public val renderCause: RenderCause, + public val durationUptime: Duration ) /** @@ -43,8 +43,8 @@ public sealed interface RenderCause { * First creation of the root workflow for the runtime. */ public class RootCreation( - val runnerName: String, - val workflowName: String, + public val runnerName: String, + public val workflowName: String, ) : RenderCause { override fun toString(): String { return "Creation of $runnerName root workflow $workflowName" @@ -55,9 +55,9 @@ public sealed interface RenderCause { * An action was handled. */ public class Action( - val actionName: String, - val workerIncomingName: String?, - val workflowName: String, + public val actionName: String, + public val workerIncomingName: String?, + public val workflowName: String, ) : RenderCause { override fun toString(): String { return "Output:A($actionName)/R($workerIncomingName)/W($workflowName)" @@ -78,8 +78,8 @@ public sealed interface RenderCause { * A rendering callback was invoked. */ public class Callback( - val actionName: String, - val workflowName: String, + public val actionName: String, + public val workflowName: String, ) : RenderCause { override fun toString(): String { return "Callback:A($actionName)/W($workflowName)" diff --git a/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/WorkflowRuntimeLoopListener.kt b/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/WorkflowRuntimeLoopListener.kt index 7c9582d88..7360b9415 100644 --- a/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/WorkflowRuntimeLoopListener.kt +++ b/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/WorkflowRuntimeLoopListener.kt @@ -13,7 +13,7 @@ public fun interface WorkflowRuntimeLoopListener { * Called whenever the runtime loop completes with all the update events that have happened in * that loop. */ - public fun onRuntimeLoopTick( + public fun onRuntimeLoopSettled( configSnapshot: ConfigSnapshot, runtimeUpdates: RuntimeUpdates ) diff --git a/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/WorkflowRuntimeMonitor.kt b/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/WorkflowRuntimeMonitor.kt index 985e4021f..c4a8fba19 100644 --- a/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/WorkflowRuntimeMonitor.kt +++ b/workflow-tracing/src/main/java/com/squareup/workflow1/tracing/WorkflowRuntimeMonitor.kt @@ -14,7 +14,7 @@ import com.squareup.workflow1.WorkflowInterceptor.RenderContextInterceptor import com.squareup.workflow1.WorkflowInterceptor.RenderPassSkipped import com.squareup.workflow1.WorkflowInterceptor.RenderingConflated import com.squareup.workflow1.WorkflowInterceptor.RenderingProduced -import com.squareup.workflow1.WorkflowInterceptor.RuntimeLoopTick +import com.squareup.workflow1.WorkflowInterceptor.RuntimeSettled import com.squareup.workflow1.WorkflowInterceptor.RuntimeUpdate import com.squareup.workflow1.WorkflowInterceptor.WorkflowSession import com.squareup.workflow1.applyTo @@ -293,8 +293,8 @@ public class WorkflowRuntimeMonitor( // runtimeUpdates.logUpdate(ProducedLogLine) } - RuntimeLoopTick -> { - runtimeLoopListener?.onRuntimeLoopTick( + RuntimeSettled -> { + runtimeLoopListener?.onRuntimeLoopSettled( configSnapshot, runtimeUpdates ) diff --git a/workflow-tracing/src/test/java/com/squareup/workflow1/tracing/WorkflowRuntimeMonitorTest.kt b/workflow-tracing/src/test/java/com/squareup/workflow1/tracing/WorkflowRuntimeMonitorTest.kt index c185d1f33..1864a643f 100644 --- a/workflow-tracing/src/test/java/com/squareup/workflow1/tracing/WorkflowRuntimeMonitorTest.kt +++ b/workflow-tracing/src/test/java/com/squareup/workflow1/tracing/WorkflowRuntimeMonitorTest.kt @@ -14,7 +14,7 @@ import com.squareup.workflow1.WorkflowInterceptor.RenderContextInterceptor import com.squareup.workflow1.WorkflowInterceptor.RenderPassSkipped import com.squareup.workflow1.WorkflowInterceptor.RenderingConflated import com.squareup.workflow1.WorkflowInterceptor.RenderingProduced -import com.squareup.workflow1.WorkflowInterceptor.RuntimeLoopTick +import com.squareup.workflow1.WorkflowInterceptor.RuntimeSettled import com.squareup.workflow1.WorkflowInterceptor.RuntimeUpdate import com.squareup.workflow1.WorkflowInterceptor.WorkflowSession import com.squareup.workflow1.identifier @@ -277,7 +277,7 @@ internal class WorkflowRuntimeMonitorTest { } @Test - fun `onRuntimeUpdate handles RuntimeLoopTick`() { + fun `onRuntimeUpdate handles RuntimeLoopSettled`() { val monitor = WorkflowRuntimeMonitor( runtimeName = runtimeName, workflowRuntimeTracers = listOf(fakeRuntimeTracer), @@ -290,10 +290,10 @@ internal class WorkflowRuntimeMonitorTest { // Initialize to set up config snapshot monitor.onSessionStarted(testScope, rootSession) - monitor.onRuntimeUpdate(RuntimeLoopTick) + monitor.onRuntimeUpdate(RuntimeSettled) assertTrue(fakeRuntimeTracer.onRuntimeUpdateEnhancedCalled) - assertTrue(fakeRuntimeLoopListener.onRuntimeLoopTickCalled) + assertTrue(fakeRuntimeLoopListener.onRuntimeLoopSettledCalled) assertTrue(monitor.renderIncomingCauses.isEmpty()) } @@ -334,7 +334,7 @@ internal class WorkflowRuntimeMonitorTest { val logLine = UiUpdateLogLine("Test update") monitor.addRuntimeUpdate(logLine) - monitor.onRuntimeUpdate(RuntimeLoopTick) + monitor.onRuntimeUpdate(RuntimeSettled) assertContains(runtimeListener.runtimeUpdatesReceived!!.readAndClear(), logLine) } @@ -357,7 +357,7 @@ internal class WorkflowRuntimeMonitorTest { monitor.renderIncomingCauses.add(RootCreation(runtimeName, "TestWorkflow")) monitor.onRuntimeUpdate(RenderPassSkipped) - monitor.onRuntimeUpdate(RuntimeLoopTick) + monitor.onRuntimeUpdate(RuntimeSettled) val updates = runtimeListener.runtimeUpdatesReceived!!.readAndClear() assertTrue(updates.any { it is SkipLogLine }) @@ -378,7 +378,7 @@ internal class WorkflowRuntimeMonitorTest { monitor.onSessionStarted(testScope, rootSession) monitor.onRuntimeUpdate(RenderingConflated) - monitor.onRuntimeUpdate(RuntimeLoopTick) + monitor.onRuntimeUpdate(RuntimeSettled) val updates = runtimeListener.runtimeUpdatesReceived!!.readAndClear() // RenderingConflated is commented out in the implementation, so no log line should be added @@ -400,7 +400,7 @@ internal class WorkflowRuntimeMonitorTest { monitor.onSessionStarted(testScope, rootSession) monitor.onRuntimeUpdate(RenderingProduced) - monitor.onRuntimeUpdate(RuntimeLoopTick) + monitor.onRuntimeUpdate(RuntimeSettled) val updates = runtimeListener.runtimeUpdatesReceived!!.readAndClear() // RenderingProduced is commented out in the implementation, so no log line should be added @@ -433,7 +433,7 @@ internal class WorkflowRuntimeMonitorTest { session = rootSession ) - monitor.onRuntimeUpdate(RuntimeLoopTick) + monitor.onRuntimeUpdate(RuntimeSettled) val updates = runtimeListener.runtimeUpdatesReceived!!.readAndClear() assertTrue(updates.any { it is RenderLogLine }) @@ -821,14 +821,14 @@ internal class WorkflowRuntimeMonitorTest { } private class TestWorkflowRuntimeLoopListener : WorkflowRuntimeLoopListener { - var onRuntimeLoopTickCalled = false + var onRuntimeLoopSettledCalled = false var runtimeUpdatesReceived: RuntimeUpdates? = null - override fun onRuntimeLoopTick( + override fun onRuntimeLoopSettled( configSnapshot: ConfigSnapshot, runtimeUpdates: RuntimeUpdates ) { - onRuntimeLoopTickCalled = true + onRuntimeLoopSettledCalled = true runtimeUpdatesReceived = runtimeUpdates } }