Closed mrut2pac closed 3 years ago
The below operations need to be atomic:
requests.Add(requestsCount); Interlocked.Exchange(ref requestsCount, 0);
Otherwise we may get the requestsCount incremented in between the lines and resetting to 0 may lose some of the requests.
requestsCount
The quick fix could be look like:
var requestsCountCopy = requestsCount; requests.Add(requestsCountCopy); Interlocked.Add(ref requestsCount, -requestsCountCopy);
Something like this, IMHO, should remove the test flakiness.
Okay good. I'm about to create a new PR to manage another issue we have.
The below operations need to be atomic:
Otherwise we may get the
requestsCount
incremented in between the lines and resetting to 0 may lose some of the requests.The quick fix could be look like:
Something like this, IMHO, should remove the test flakiness.