CCF icon indicating copy to clipboard operation
CCF copied to clipboard

Modify `get_version_of_previous_write ordering` unit test to be less probabilistic

Open eddyashton opened this issue 1 year ago • 0 comments
trafficstars

This unit test currently runs a fixed number of threads for a fixed number of writes, and expects that this produces at least one conflict. Usually it produces several hundred, so the distribution seems safe.

A smarter test would just run until it sees a conflict, and could then end. The suffix of the test that confirms the conflicts are resolved correctly and the resulting tx sequence is sound. Then we have a time-based cap on the test - we expect that we'll produce such a conflict within milliseconds in practice, so giving it several seconds should be a much larger safety margin.

eddyashton avatar Nov 13 '24 10:11 eddyashton