Old FR10 coupon completion jumps into the new attempt in our test

MiaBarnes0557 · 23 Jun 2026, 12:38 UTC

Reply to discussion
MI
MiaBarnes0557
Our offline tracker finishes the newer attempt when an older completion arrives late. I want a repeatable event sequence, not another lucky random sleep. The duplicate-result count needs checking too.

17 replies

LU
LucaAli0178
Replying to MiaBarnes0557

Put event delivery under the test's control. Create the two attempts with explicit identities, keep the first result queued, and deliver it only after the second reaches the state you're testing. Assert both attempt states and the report after each delivery, then advance a controlled clock for the timeout cases. Nothing in that sequence needs a physical coupon cycle or a random wait

21 points
PA
PavelChan1049
Replying to LucaAli0178

Before designing the expected answer, check whether the actual completion carries an attempt identifier. If only your test helper knows which attempt it belongs to, you've built a very clever test of an interface you don't have.

13 points
MI
MiaBarnes0557
Replying to PavelChan1049

Captured events do carry the identifier. Our handler discards it and updates currentAttempt. The harness can feed that captured shape directly, so the missing association is in our code.

5 points
EL
EllaBaker0468
Replying to MiaBarnes0557

Then preserve that captured failing example as the regression case. It gives the fix a clear target.

8 points
AN
Anders_Briggs
Replying to MiaBarnes0557

I would also send an identity the tracker has never seen. Otherwise a fix can stop stealing a known old result and still attach every unknown event to whatever happens to be active.

20 points
NI
NinaBrown0936
Replying to Anders_Briggs

And restart while a result is held for review. We once built a careful first recovery page and let the next startup turn the same row back into fresh work. It was a very efficient way of undoing the careful part.

12 points
TO
TobyBrooks0840
Replying to NinaBrown0936

Nina, that restart case should check the report too. Does its processed-result identity survive separately from the screen state? A reopened screen can look right while its summary rebuild counts an old delivery again.

10 points
AN
AnitaCampbell
Replying to MiaBarnes0557

Who will decide the report's expected coupon count, Mia, rather than letting the test repeat whatever number the current screen produces?

18 points
MI
MiaBarnes0557
Replying to AnitaCampbell

Quality is defining the expected item dispositions with our developer. The controlled old-result sequence reproduces the failure, and we've added unknown identity plus duplicate delivery before and after restart.

10 points
PA
PavelChan1049
Replying to TobyBrooks0840

Toby's persistence question is the one I'd keep an eye on. Matching an event in memory is the easy half if the same event can be delivered after the process has forgotten it ever existed.

22 points
LU
LucaAli0178
Replying to PavelChan1049

Use the same persisted fixture data across that restart test, not a new empty store that gives every run a clean slate. Then deliver the identical completion again and compare the saved attempt, review entries and accepted-item summary. Keep any authorised retry as a new attempt belonging to the same item, not a second physical coupon

17 points
MI
MiaBarnes0557
Replying to LucaAli0178

The corrected handler now matches known identities, leaves unknown ones in review and does not change the active attempt for an old result. First duplicate test passes; restart replay still adds a summary count, so we found a second defect.

4 points
TO
TobyBrooks0840
Replying to MiaBarnes0557

Does the summary rebuild use event rows or reviewed item state? If it counts delivered rows, persistence alone won't stop repeated observations looking like more coupons.

11 points
MI
MiaBarnes0557
Replying to TobyBrooks0840

It used delivered rows. Developer changed the summary to derive from identified items and reviewed disposition, retaining the attempt events separately. Quality's small example now matches after the rebuild.

16 points
EL
EllaBaker0468
Replying to MiaBarnes0557

Thank you for returning with the second cause. Have the unknown and interrupted-write cases passed too?

21 points
AN
Anders_Briggs
Replying to EllaBaker0468

Ella, I'd want those results, but don't lose the original ordering regression while adding them. A rebuilt count can be right for the sample while a late event still changes the wrong attempt state.

6 points
MI
MiaBarnes0557
Replying to EllaBaker0468

All named cases pass now: old result while new is pending and after it finishes, duplicate before and after restart, unknown identity, and interrupted persistence followed by replay. Both attempt states and quality's item total are asserted. Maintainer accepted this reconciliation fix; no robot motion or inspection capability was tested.

13 points

Add to the discussion

Welcome to Application Robot

Everyone can read the forum. Sign in or create an account to start a discussion, reply, or upload photos.

Forgot your password?

By creating an account, you agree to our Terms and Conditions and community guidelines. Read our Privacy Policy for how your information is handled.