elsa-core/test
Sipke Schoorstra 37c98b2a78
test(bpmn): compensation, targeted replay and transaction cancellation (#7960)
* test(bpmn): cover compensation, targeted replay and transaction cancellation

W15 turns on compensation boundary events, reverse-order replay, targeted
compensation, transaction subprocesses and cancel end/boundary events. The
measured claim in the design holds: the command applier needs no changes, and
none were made. A compensation handler arrives as an ordinary StartWork
carrying cause=compensation, and the binder already binds it because the reader
emits an ordinary Primary binding for an isForCompensation element.

What is new is the test mass that says so, and each case pins a failure that
otherwise looks like success:

- three registrations replayed in reverse, asserted as an ordered log rather
  than as "all three ran"
- a compensate throw naming an activityRef, where the two unselected handlers
  are bound work that must stay unrun -- which is also where "a handler is
  never scheduled from flow" becomes observable
- a compensation run torn down mid-replay by a cancel end event, so its claimed
  but unrun entry is released back to registered and the cancellation's own
  replay reaches it; leaving it claimed would cancel with nothing to compensate
  and finish looking healthy
- a transaction completing Cancelled with no cancel boundary to route it, which
  must fault rather than take the ordinary sequence flow
- two compensation logs, one per scope, in a subprocess and around it

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test(bpmn): pin the duplicate live-work record a cancelled transaction leaves

CompensationRunCancelledMidReplay asserted only log counts and Finished, so
the two live ledger records/bookmarks it produces for the releaseSeat slot
went unasserted. Add an explicit assertion on the scope's ledger, and correct
the comment that framed the second handler start as evidence only of the
release working, when it is also the symptom of the interpreter defect
tracked in #7959.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 23:25:36 +02:00
..
component test(component): correct coverage gate to 23 2026-08-14 16:23:23 +02:00
integration test(bpmn): compensation, targeted replay and transaction cancellation (#7960) 2026-08-19 23:25:36 +02:00
performance Merge release/3.8.0 into main 2026-08-14 11:59:35 +02:00
TlsSmoke [codex] Fix console log metadata and type resolution (#7542) 2026-05-30 22:52:01 +02:00
unit feat(bpmn): interchange endpoints (analyze, import, export) (#7954) 2026-08-18 05:20:42 +02:00
Directory.Build.props Upgrade projects to target .NET 10, add conditional System.Linq.Async dependencies for compatibility with earlier frameworks, and update project files for consistency across the solution. (#7062) 2025-11-21 20:55:30 +01:00
Directory.Build.targets [codex] Harden initial security remediation slice (#7495) 2026-05-22 00:45:47 +02:00