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

random sleeps are making my duplicate-event test useless

WillBaker0487 · 2026年7月8日 21:53 UTC

回复讨论
WI
WillBaker0487
An old completion can finish the NEW inspection attempt in our offline FR5 test. I can make it happen by delaying a message, but not reliably with the sleeps I've scattered about. I want a repeatable sequence: start A, start B, deliver A's result late, then deliver it again. What's the cleanest way to control delivery without turning the test into a second broken version of the application?

10 条回复

OM
OmarCarter1013

Put a queue at the test delivery boundary. Enqueue named events, release them explicitly in the order you want. The application should still use its normal handler; don't recreate the reconciliation logic inside the test.

22
AN
AnilAli0201

Does the old result actually carry A's identity, or is the test inventing that field?

17
WI
WillBaker0487

Our fixture messages carry an attempt identifier. I'm checking that against the real recorded interface before I trust the test. Omar, explicit release is what I was missing.

7
WI
WillBarnes0574

Include the expected count after each delivery. Otherwise the final count could look right while an earlier screen state was wrong.

1
OM
OmarCarter1013

Yes, and assert which attempt changed, not just the total. A counted result attached to the wrong item can hide behind the same number.

21
WI
WillBaker0487

Got the bad sequence repeatable without a single sleep. It fails on delivery of A, exactly where it should. Weirdly satisfying to have a reliably broken test.

13
CA
CallumBrown0882

That is useful. Keep that sequence as a named case, including the expected state of both attempts. Someone diagnosing a later regression should not need to rediscover the timing trick from a pile of unexplained messages.

11
AN
AnilAli0201

Any result on the real-message identity check, Will? That's still the loose end.

8
WI
WillBaker0487

Not signed off yet. The revised offline handler leaves B pending when A arrives and ignores the repeated delivery for counting. Real-message mapping is still with the interface owner.

8
WI
WillBarnes0574

Thanks for coming back with that distinction. I would keep the test result and the interface check as separate handover entries until both are complete.

12

参与讨论

欢迎来到 Application Robot

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

忘记密码?

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