Why does our old coupon completion finish the new attempt?

DineshBrown0908 · 2025年9月13日 10:35 UTC

已关闭

主帖中文翻译暂不可用,以下显示英文原文;回复保留原文。 查看英文原文

DI
DineshBrown0908
Our offline UR5e tracker gives attempt two the result from attempt one when I delay the first completion. Random sleeps hide it half the time. How should I make that test repeatable?

9 条回复

GA
GabrielAdams0105

We stopped using wall-clock delays for this sort of test and delivered queued messages at named steps instead. Hold the old completion, establish the new attempt, then deliver the old one. Check the stored state right there, before anything else can tidy it up.

2分
DI
DineshBrown0908

I can do that with our test loader. Both completions contain an attempt reference; our helper only compares the coupon label. That looks like the mistake.

4分
GA
GabrielAli0192

Does the new attempt stay pending after the old completion in your revised test?

5分
DI
DineshBrown0908

With the old code, no. The test fails at that point every time now. I haven't changed the matcher yet.

20分
GA
GabrielAdams0105

Useful. Now you can show the fault without telling someone to run it until they're lucky. Include the current completion after that failed step when testing the fix, so rejecting everything won't count as success.

12分
DI
DineshBrown0908

Updated matcher uses the attempt reference as well as the coupon. Old result no longer closes the new attempt, and the current result still works. Thanks for the queued ordering.

23分
GA
GabrielAli0192

What does a second copy of the current result do?

16分
DI
DineshBrown0908

Found another bug there. It increments the total twice even though the attempt stays completed. Adding that duplicate to the test before changing the count handling.

15分
GA
GabrielAdams0105

Good catch. Keep the old-result and duplicate-current-result cases separate in the output, because you've found two different mistakes and a future maintainer needs to see which one returns.

11分

讨论已关闭

此讨论已连续六个月没有活动,现已关闭新回复。 最后活动: .