Testing Live Watchlist Events Reliably by Modeling Presence, Not Timing
The article argues that flaky tests for a live trading watchlist stem from treating event time, batching, and delivery as timing problems rather than state. It recommends making event time an explicit dependency, flushing batches using a defined watermark, and asserting symbol presence as a state transition instead of relying on fixed sleeps. The author notes that batching delays are intentional and that transport ordering from protocols like WebRTC does not define what counts as current in the application. A deterministic reducer that tracks each symbol's latest sequence and status can be tested with an in-memory clock, while the network layer is tested separately. The approach keeps the production batching rules intact while removing sources of noise from CI runs.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in