mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-07 00:55:21 +00:00
Return 0 instead of doing another rt:sysread
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 commit is contained in:
parent
8a6ba3fbf5
commit
3c8dce8962
@ -195,14 +195,17 @@ wait_until_fullsync_stopped(SourceLeader) ->
|
||||
end).
|
||||
|
||||
wait_for_reads(Node, Start, End, Bucket, R) ->
|
||||
rt:wait_until(Node,
|
||||
ok = rt:wait_until(Node,
|
||||
fun(_) ->
|
||||
Reads = rt:systest_read(Node, Start, End, Bucket, R, <<>>, true),
|
||||
Reads == []
|
||||
end),
|
||||
Reads = rt:systest_read(Node, Start, End, Bucket, R, <<>>, true),
|
||||
lager:info("Reads: ~p", [Reads]),
|
||||
length(Reads).
|
||||
%% rt:systest_read/6 returns a list of errors encountered while performing
|
||||
%% the requested reads. Since we are asserting this list is empty above,
|
||||
%% we already know that if we reached here, that the list of reads has
|
||||
%% no errors. Therefore, we simply return 0 and do not execute another
|
||||
%% systest_read call.
|
||||
0.
|
||||
|
||||
get_fs_coord_status_item(Node, SinkName, ItemName) ->
|
||||
Status = rpc:call(Node, riak_repl_console, status, [quiet]),
|
||||
|
Loading…
Reference in New Issue
Block a user