I need to choose exactly when the old coupon result arrives

NathanArcher0373 · 23 Aug 2026, 03:40 UTC

Reply to discussion
NA
NathanArcher0373
Same job label isn't enough to identify an attempt. My offline UR5e coupon test demonstrates that: an old completion closes the new attempt. Random sleeps make reproducing it a nuisance. How do I hold and release specific events?

13 replies

HA
HanaBrown0883
Replying to NathanArcher0373

Put a controllable queue between your fake event source and the application. Keep both messages visible, then release the old completion only after the new attempt is waiting. No timing lottery needed.

9 points
JA
JaneAllen0336
Replying to HanaBrown0883

Make the expected pending attempt explicit before delivery. Otherwise the test can pass by ignoring every completion, including the valid one.

13 points
LO
LouisBell0659
Replying to HanaBrown0883

Does the real recorded event carry an attempt identity, or would your fake be giving the application information it never receives?

4 points
NA
NathanArcher0373
Replying to LouisBell0659

Recorded events have an attempt field. My handler was searching by job label. Fake events use the recorded shape.

1 points
GA
GabrielBaker0453
Replying to NathanArcher0373

Would two copies of the current completion also increment your finished count twice?

5 points
HA
HanaBrown0883
Replying to GabrielBaker0453

Good second case, Gabriel. Keep the delayed old message and the duplicate current message as separate named tests first. A long mixed sequence is harder to diagnose when it breaks.

12 points
NA
NathanArcher0373
Replying to HanaBrown0883

Queue is in. Old completion reproduces the false finish every time. Duplicate current completion also increments twice. Two separate failures now.

21 points
JA
JaneAllen0336
Replying to NathanArcher0373

That is useful progress. Check both stored status and displayed count after each delivery; fixing only the screen can leave the next launch wrong.

7 points
NA
NathanArcher0373
Replying to JaneAllen0336

Handler now matches attempt identity and ignores a repeated completed transition. Old result leaves new pending; current result completes once; duplicate leaves count unchanged. Stored and displayed values agree.

9 points
LO
LouisBell0659
Replying to NathanArcher0373

What about an event whose attempt field is missing, rather than merely old?

7 points
GA
GabrielBaker0453
Replying to NathanArcher0373

And a restart between the two copies, since the duplicate memory might only live in the running process?

7 points
NA
NathanArcher0373
Replying to LouisBell0659

Missing identity now stays unassigned with a diagnostic entry. Restart test isn't written. I won't call duplicate handling complete across restarts yet.

7 points
HA
HanaBrown0883
Replying to NathanArcher0373

I'd leave that restart case as its own open test, exactly as you have. The controlled queue solved the reproducibility problem, and your passing cases have a clear boundary instead of depending on how fast the machine happened to run.

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