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.
简体中文界面。帖子、指南及政策正文保留原文;未对原文作自动翻译。
Yesterday's coupon attempt finishes today's FR5 test
LeahBrown0930 · 2026年4月24日 14:03 UTC
19 条回复
Does it really change the newer row, or just display the older result beside it?
19分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分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分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分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分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分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分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分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分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分Does delivering that old result twice change the history twice?
22分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分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分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分What does the current attempt show during that conflict? The history warning should not cover up which work is still waiting.
6分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分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分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分