Flaky under load: Galaxy EventPumpBoundedChannelTests.Drops_newest_when_channel_fills_and_records_metric #503
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while running the full unit-test sweep on merged master (
28c28667). Pre-existing and unrelated to that merge —EventPumpBoundedChannelTests.csis untouched by it, and the file's last change (560b327e) predates the work.Test:
ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Tests.Runtime.EventPumpBoundedChannelTests.Drops_newest_when_channel_fills_and_records_metricFailure:
Shouldly.ShouldAssertException : counters.Received— the drop metric did not reach the expected count.Reproduction (measured):
Driver.Galaxy.Testsin isolation -> 0 failures.Runtime.Tests+AdminUI.Tests+Core.Testsrunning concurrently -> 1 failure (run 11).So it needs CPU contention, like the #500 family did. Recipe that catches it:
Always capture
trx— a summary-only run loses the test name and costs a full re-run to recover.Likely shape (not yet confirmed — I did not diagnose this one). The test drives a bounded channel to overflow and asserts a drop count. Counts like that are usually observed after a producer/consumer race, so the assertion can be evaluated before the drops have been recorded, or the consumer can drain fast enough under different scheduling that fewer drops occur than the test assumes. Worth checking which of those it is before changing anything — #500 had two hypotheses that looked obvious and were both wrong under measurement.
See #500 for the presence-vs-absence assertion rule, which resolved eight tests of a similar character in
Runtime.Tests.