Our offline FR10 reporting test accepts a delayed completion from an abandoned attempt. I can trigger it by hand but the sleep-based test rarely catches it. Can I control delivery without changing the reporting code?
Put a controllable queue at the event boundary. Start an attempt, retain its completion, abandon it, start another, then deliver the retained event explicitly. No sleeping required.
That reproduces it every run. The old event carries its original attempt identifier, but our handler only checks which coupon is active. Where would you reject it?
At the state update, before anything becomes complete. The coupon can legitimately recur; the particular attempt cannot borrow another attempt's result.
Give your duplicate test something to count as well. We had a display stay correctly green while the same completion added two entries to the downstream list. Looked perfect until somebody counted the rows.
Fixed in our offline handler. Old completion leaves the newer attempt waiting; its own completion finishes it. Duplicating either event adds no extra result. Mei's row-count check caught our second insertion path too.
Good catch on that second path. I'd leave both checks in, display state and result count. Someone will tidy the code later and wonder why the apparently redundant one exists.