Skip to content

Commit

Permalink
Workaround for flaky MetricCollector test (#4113)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Taillefer <mataille@microsoft.com>
  • Loading branch information
geeknoid and Martin Taillefer authored Jun 23, 2023
1 parent 52ebc1b commit 62ee57e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ public static async Task Dispose()
await Assert.ThrowsAsync<ObjectDisposedException>(async () => await collector.WaitForMeasurementsAsync(1));
await Assert.ThrowsAsync<ObjectDisposedException>(async () => await collector.WaitForMeasurementsAsync(1, TimeSpan.FromSeconds(1)));

// HACK: there seems to be something executing asynchronously which takes a while to finish. This needs to be tracked on
// I'm adding the sleep here to keep the test from being flaky.
Thread.Sleep(2000);

Assert.True(wait.IsCompleted);
Assert.True(wait.IsFaulted);

Expand Down

0 comments on commit 62ee57e

Please sign in to comment.