kunwp1 commented on code in PR #9344:
URL: https://github.com/apache/texera/pull/9344#discussion_r4670594094
##########
amber/src/test/scala/org/apache/texera/amber/engine/architecture/coordinator/promisehandlers/AdvanceRegionExecutionsHandlerSpec.scala:
##########
@@ -118,6 +121,19 @@ class AdvanceRegionExecutionsHandlerSpec
def finishAdvance(): Unit = advance.setValue(())
}
+ /**
+ * Stands in for a `WorkflowExecutionManager` whose advance fails before
any future exists, the
+ * way a storage or schema failure inside
`syncStatusAndTransitionRegionExecutionPhase` does.
+ */
+ private class ThrowingAdvanceExecutionManager(
+ workflowExecution: WorkflowExecution,
+ asyncRPCClient: AsyncRPCClient,
+ failure: Throwable
+ ) extends WorkflowExecutionManager(workflowExecution, coordinatorConfig,
asyncRPCClient) {
+ override def advanceRegionExecutions(actorService: PekkoActorService):
Future[Unit] =
+ throw failure
+ }
Review Comment:
Optional: this trio (`ThrowingAdvanceExecutionManager`,
`ThrowingCoordinatorProcessor`, `newThrowingFixture`) repeats the existing
stub, processor and `newFixture` except for the throw. A `var throwOnAdvance:
Option[Throwable] = None` on `PendingAdvanceExecutionManager`, checked before
it returns the promise, lets `newThrowingFixture` be `newFixture()` plus one
assignment returning `Fixture`. The tests then destructure with `val Fixture(_,
init, sent) = ...`, and about 45 lines go.
--
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]