Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing MetricEventSource tests (#55385)
* Fixing MetricEventSource tests I've seen two recent non-deterministic failures: 1. After starting the EventListener there is a delay of one collection interval (previously 0.3 seconds) where we expect calls to counter.Add and Histogram.Record() to update stats. On a fast machine this code would run in under a millisecond but in some test runs it still wasn't happening fast enough. 2. We were seeing error events from a previous test get observed in a later test because session id was being ignored for error events. Fixes: 1. Added an initial collection interval where no counter APIs will be invoked and the test will delay up to 60 seconds waiting for this. Hopefully this delay makes it more likely that the Add/Record APIs are ready to execute promptly once the 2nd interval begins. I also increased the intervals to 1 second. If that still isn't sufficient we can either further increase the collection intervals or disable the tests. I also moved these tests to outerloop because they are slow and noisy on the console, but it may have a side benefit lessening the impact if there are future timing related failures. 2. Tightened up the session id matching so only error events with empty id or the expected id are allowed.
- Loading branch information