Moved from GitHub ristretto/162
Posted by nes1983:
The readme file shows that in order to test ristretto, one must use time.Sleep. As far as I understand, that isn’t good software engineering practice. In fact, it’s conceptually inherently a race condition. I understand it isn’t the kind of race condition that can yield memory corruption. But still – any test that relies on test.Sleep can fail if it misjudges how long an operation can take.
I’d like to propose a test-only mode that makes the Set operation blocking, until the write has completed. With it, one can write more predictable, simpler unit test.