Permalink
Browse files

Try to fix sporadic eunit test failure due to race in riak_core_trace…

…r.erl via multi_scheduling block
  • Loading branch information...
1 parent d66364d commit e2e44739e9529a0b23c0dbfda98b9a9f2efdb30a @slfritchie slfritchie committed Aug 11, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/riak_core_tracer.erl
View
@@ -139,7 +139,10 @@ handle_call({collect, Duration, Nodes}, _From, State) ->
{reply, ok, State#state{trace=[], stop_tref = Tref, tracing = true}};
handle_call(stop_collect, From, State = #state{tracing = true}) ->
%% Trigger the sentinel so that we wait for the trace buffer to flush
+ erlang:system_flag(multi_scheduling, block),
+ timer:sleep(100),
?MODULE:trigger_sentinel(),
+ erlang:system_flag(multi_scheduling, unblock),
{noreply, State#state{stop_from = From, tracing = stopping}};
handle_call(stop_collect, _From, State) ->
{reply, State#state.tracing, State};

0 comments on commit e2e4473

Please sign in to comment.