Files
scylladb/tests
Glauber Costa 378f2ba8e4 mutation_reader_test: adjust sleep time to timeout clock and duration
Raphael recently caught this test failing. I can't really reproduce it,
but it seems to me that it is a timing issue: we execute two different
statements, each one should timeout after 10ms. After 20ms, we make sure
that they both timed out.

They don't (in his system), which is explained by the fact that we are
no longer using high resolution clocks for the timeouts. Expirations for
lowres clocks will only happen at every 10ms, and in the worst case we
will miss twoa.

So the fix I am proposing here is to just account for potential
innacuracies in the clocks and calculations by waiting a bit longer.

Ideally, we would use the manual clock for this. But in this case, this
would mean adding template parameters to pretty much all of the
mutation_reader path.

Currently, not only the test failed, it also had an use-after-free
SIGSEGV. That happens because we give up on the reader while the
timeouts is still to happen.

It is the caller responsibility to ensure the lifetime of the reader is
correct. Dealing with that cleanly would require a cancelation mechanism
that we don't have, so we'll just add an assertion that will fail more
gracefully than the SIGSEGV.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
2018-01-17 17:17:40 +01:00
..
2017-12-06 14:39:40 -05:00
2018-01-11 12:07:41 -05:00
2017-07-16 11:55:08 +02:00