mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-07 00:55:21 +00:00
8cbddf3552
Add test which ensures that the AAE source worker doesn't deadlock when waiting for responses from the process which is computing the hashtree differences. Unfortunately, this test uses timeouts because as the code currently stands, I can't figure out a way to make it any cleaner.
23 lines
700 B
Erlang
23 lines
700 B
Erlang
-module(riak_kv_index_hashtree_intercepts).
|
|
-compile(export_all).
|
|
-include("intercept.hrl").
|
|
|
|
-define(M, riak_kv_index_hashtree_orig).
|
|
|
|
%% @doc Perform a delayed compare, which delays the receipt of a
|
|
%% message.
|
|
delayed_compare(_IndexN, _Remote, _AccFun, _TreePid) ->
|
|
timer:sleep(1000000),
|
|
[].
|
|
|
|
%% @doc When attempting to get the lock on a hashtree, return the
|
|
%% not_built atom which means the tree has not been computed yet.
|
|
not_built(_TreePid, _Type) ->
|
|
not_built.
|
|
|
|
%% @doc When attempting to get the lock on a hashtree, return the
|
|
%% already_locked atom which means the tree is locked by another
|
|
%% process.
|
|
already_locked(_TreePid, _Type) ->
|
|
already_locked.
|