Yesterday's coupon attempt finishes today's FR5 test

LeahBrown0930 · 24 Apr 2026, 14:03 UTC

Reply to discussion
LE
LeahBrown0930
An old completion finishes my newer coupon attempt if I delay it until the newer one starts, but random sleeps make the test wonderfully good at passing when I want to show someone the bug; how do I make the delivery order repeatable offline?

19 replies

RA
RaviBennett0737
Replying to LeahBrown0930

Give the test control of when each saved event is delivered. We caught a similar handler mistake by starting two attempts and releasing the older result deliberately, not waiting for a lucky delay. Assert which attempt changed, not just that the completed total looks plausible.

13 points
GR
GraceChen1190
Replying to LeahBrown0930

Does it really change the newer row, or just display the older result beside it?

19 points
MA
Martin_Bowen
Replying to GraceChen1190

I would test those separately. A correct saved row with a misleading display can still send the wrong coupon onward, although it needs a different fix.

17 points
LE
LeahBrown0930
Replying to GraceChen1190

It changes the newer saved row; the handler finds the latest attempt by coupon label instead of using the attempt identity carried by the event.

6 points
BR
BrunoBarnes0539
Replying to LeahBrown0930

Why keep any timing in that test then? Feed the old event into that handler after creating the new row and it should fail every time.

18 points
AN
AnnaBaker0503
Replying to LeahBrown0930

Keep the earlier attempt in the expected output too. It is easy to say the new one must stay unfinished and forget to say where the old result belongs.

15 points
NO
NoraBaker0496
Replying to AnnaBaker0503

Anna, would an earlier result still be useful if that attempt was abandoned? I wouldn't want the operator seeing an old green result beside the new work and thinking the coupon had passed.

20 points
SO
SofiaChen1152
Replying to NoraBaker0496

Nora, the event can remain attached to the abandoned attempt without accepting the current coupon. Its disposition needs to be explicit in the test. What state was Leah's earlier attempt in?

15 points
LE
LeahBrown0930
Replying to SofiaChen1152

The earlier attempt was superseded, so its delayed result belongs in that history and must not accept the current attempt; I have made that the first expected case.

23 points
RA
RaviBennett0737
Replying to BrunoBarnes0539

Bruno's direct handler test is a good starting point. I'd still send the same sequence through the application's event entry point afterwards. Ours had a second lookup there which quietly stripped away the identity the corrected handler needed.

22 points
LE
LeahBrown0930
Replying to RaviBennett0737

The direct case now fails consistently on the old handler and passes with lookup by full attempt identity; the event-entry test is next, without random sleeps.

19 points
GR
GraceChen1190
Replying to LeahBrown0930

Does delivering that old result twice change the history twice?

22 points
MA
Martin_Bowen
Replying to GraceChen1190

Use the same event identity for that duplicate. Then make a separate case for a different result event claiming the same attempt, since conflicting information should not be hidden as a harmless repeat.

15 points
BR
BrunoBarnes0539
Replying to Martin_Bowen

Martin, agreed, but keep the simple duplicate case readable. A failing test shouldn't require someone to understand the entire inspection application before they see what was counted twice.

22 points
LE
LeahBrown0930
Replying to Martin_Bowen

Duplicate delivery leaves one historical result, and a conflicting result is flagged without replacing it; both cases pass through the application entry point now.

8 points
AN
AnnaBaker0503
Replying to LeahBrown0930

What does the current attempt show during that conflict? The history warning should not cover up which work is still waiting.

6 points
LE
LeahBrown0930
Replying to AnnaBaker0503

Current attempt stays waiting, then completes only when its own matching result arrives; closing and reopening between the old deliveries preserves those states too.

21 points
NO
NoraBaker0496
Replying to SofiaChen1152

Thanks for explaining the superseded result, Sofia. I can see why deleting it would lose useful history, but showing it as the current answer would be worse.

2 points
RA
RaviBennett0737
Replying to LeahBrown0930

Those are useful repeatable checks to hand over. Keep the saved rows and screen expectations with the sequences so a future display change cannot undo the distinction while the handler tests remain green.

21 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.