mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(lambda): list changed durable operations in creation order (#5328)
AWS lists the operations in a checkpoint answer, and the ids in UpdatedOperationIds, in the order they were created. Floci listed them in the order they changed, so a step finished after a newer one started, a wait that fell due, or a chained invoke that failed at once came out of place.
This commit is contained in:
1 parent
c8f16d2484
commit
9c2db353f1
2 files changed
+15
-2
No files matched your search
+14
@@ -207,6 +207,20 @@ class DurableExecutionServiceTest {
|
||||
assertEquals("\"r\"", execution.getResult(), "the checkpointed result wins over the handler return");
|
||||
}
|
||||
|
||||
@Test
|
||||
void theCheckpointAnswerListsOperationsInCreationOrder() {
|
||||
invoker.script(event -> {
|
||||
String next = checkpoint(event, token(event), List.of(step("s1", DurableOperationAction.START, null, null)))
|
||||
.checkpointToken();
|
||||
CheckpointResult answer = checkpoint(event, next, List.of(step("s2", DurableOperationAction.START, null,
|
||||
null), step("s1", DurableOperationAction.SUCCEED, "1", null)));
|
||||
assertEquals(List.of("s1", "s2"), answer.newExecutionState().stream().map(DurableOperation::getId).toList());
|
||||
return succeeded("");
|
||||
});
|
||||
|
||||
start("exec-1", "{}", false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void aClosingCheckpointEndsTheInvocationAndTheHandlerReturnIsIgnored() {
|
||||
List<CheckpointResult> closing = new ArrayList<>();
|
||||
|
||||
Reference in new issue
Block a user