简体中文界面。帖子、指南及政策正文保留原文;未对原文作自动翻译。

I need to choose exactly when the old coupon result arrives

NathanArcher0373 · 2026年8月23日 03:40 UTC

回复讨论
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 条回复

HA
HanaBrown0883

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
JA
JaneAllen0336

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

13
LO
LouisBell0659

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

4
NA
NathanArcher0373

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

1
GA
GabrielBaker0453

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

5
HA
HanaBrown0883

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
NA
NathanArcher0373

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

21
JA
JaneAllen0336

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
NA
NathanArcher0373

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
LO
LouisBell0659

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

7
GA
GabrielBaker0453

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

7
NA
NathanArcher0373

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
HA
HanaBrown0883

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

参与讨论

欢迎来到 Application Robot

所有人都可以阅读论坛。登录或注册后即可发起讨论、回复或上传照片。

忘记密码?

注册账号即表示你同意我们的 使用条款 社区准则。请阅读我们的 隐私政策 ,了解我们如何处理你的信息。