aglinxinyuan opened a new pull request, #5440: URL: https://github.com/apache/texera/pull/5440
### What changes were proposed in this PR? Adds `ClientEventSpec` covering all nine subtypes of the controller→client `ClientEvent` family. The trait extends `WorkflowFIFOMessagePayload` and flows over Pekko, so the spec round-trips each subtype via the production wire path (`AmberRuntime.serde`). | Subtype | Pinned | | --- | --- | | `ExecutionStateUpdate` | Exposes `state`; round-trips via `AmberRuntime.serde`; case-class equality + hashCode distinguish different states. | | `ExecutionStatsUpdate` | Exposes `operatorMetrics`; round-trip preserves both populated and empty metrics maps. | | `RuntimeStatisticsPersist` | Round-trips `operatorMetrics`. | | `ReportCurrentProcessingTuple` | Exposes `operatorID` and the `Array[(Tuple, AVI)]` tuple field; round-trip preserves operatorID and array length (Array equality is reference-based at the case-class level, so length is the right pin without over-constraining serializer choice). | | `WorkerAssignmentUpdate` | Exposes `workerMapping`; round-trip preserves both populated and empty mappings. | | `FatalError` | Defaults `fromActor` to `None`; explicit `Some(actorId)` round-trips; the carried `Throwable` survives by message + class (Throwable equality is reference-based, so we don't pin the instance). | | `UpdateExecutorCompleted` | Round-trips the actor id. | | `ReplayStatusUpdate` | Round-trips `status = true` and `status = false` independently. | | `WorkflowRecoveryStatus` | Round-trips `isRecovering = true` and `isRecovering = false` independently. | | Cross-subtype | `ExecutionStatsUpdate` and `RuntimeStatisticsPersist` share the `Map[String, OperatorMetrics]` field shape; case-class equality still distinguishes them across types. | Membership in `ClientEvent` and (transitively) `WorkflowFIFOMessagePayload` is enforced at compile time by `: ClientEvent` ascriptions plus a runtime `isInstanceOf[WorkflowFIFOMessagePayload]` sweep — a regression that demoted the trait off `WorkflowFIFOMessagePayload` would surface immediately. The suite owns a suite-local Pekko `ActorSystem` injected into `AmberRuntime` via reflection, torn down via `TestKit.shutdownActorSystem` in `afterAll` (same pattern as `CheckpointSubsystemSpec`). No production code changed; this is test-only. ### Any related issues, documentation, discussions? Closes #5437 ### How was this PR tested? ``` sbt "WorkflowExecutionService/Test/testOnly org.apache.texera.amber.engine.architecture.controller.ClientEventSpec" # → 17 tests, all pass sbt "WorkflowExecutionService/Test/scalafmtCheck" # → clean ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 4.7) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
