Our offline handler sometimes credits an old completion to the new bracket attempt. Random sleeps make it intermittent. How can I test the event order directly instead of waiting for it to misbehave?
Hold the first completion in a test queue. Start the second attempt, then release the held event on command. Use separate attempt identities even if both refer to the same bracket.
Good failing case. Assert which attempt changes, which stays pending, and what the history contains. A fixed headline count can still hide a result attached to the wrong attempt.
Also send the newer attempt's real completion afterwards. Otherwise a handler that ignores everything could pass your old-event test while never finishing any useful work.
Fixed handler matches the attempt identity. Old completion updates only its own history, newer attempt remains pending until its real result, and duplicates change neither count nor disposition. Saved-state restart repeats the same result. Offline regression closed; this does not claim the installed cell has been tested.