-
Notifications
You must be signed in to change notification settings - Fork 72
Return 0 instead of doing another rt:sysread in repl_util:wait_for_reads/5 #949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Previously, wait_until_read function would execute another rt:systest_read call and return a count of errors, when we already asserted above that the list is empty. If the wait_until function does not return true, or times out, or hits the retry limit, the running test ought to fail anyway without needing an additional read to fail. So doing another call is redundant and unnecessary; we just return 0 as the value if rt:wait_until completes successfully.
|
This PR is intended to address an issue we looked at while reviewing #931 - this particular function is called all over the repl tests, so some care ought to be used before merging. |
repl_aae_fullsync.erl
repl_aae_fullsync_bench.erl
repl_aae_fullsync_custom_n.erl
repl_rt_heartbeat.erl
repl_rt_overload.erl
repl_rt_pending.erl
repl_util.erl
replication2.erl
replication2_dirty.erl
rt_cascading.erlThese modules have calls to |
./riak_test -c rtdev -t repl_aae_fullsync \
> -t repl_aae_fullsync_bench \
> -t repl_aae_fullsync_custom_n \
> -t repl_rt_heartbeat \
> -t repl_rt_overload \
> -t repl_rt_pending \
> -t repl_util \
> -t replication2 \
> -t replication2_dirty \
> -t rt_cascading |
|
It looks like |
|
@JeetKunDoug has been wrestling with this test too - I think its failures are unrelated to this particular change. |
|
@mrallen1 I tested this and it looks good, however, I'm looking at the usage in the tests and they are testing a single node, not an array of nodes, so the assert we expected to happen earlier in https://github.com/basho/riak_test/blob/mra/repl-util-read-fix/src/rt.erl#L675 does not happen. So if there is an error, it now reports it as having no problems. |
|
@javajolt From my reading of |
|
Fair enough. The length will only be 0 if it succeeds anyway. |
Return 0 instead of doing another rt:sysread in repl_util:wait_for_reads/5
Previously, wait_until_read function would execute
another rt:systest_read call and return a count of
errors, when we already asserted above that the list
is empty.
If the wait_until function does not return true, or
times out, or hits the retry limit, the running test
ought to fail anyway without needing an additional
read to fail.
So doing another call is redundant and unnecessary;
we just return 0 as the value if rt:wait_until
completes successfully.