Skip to content

Commit

Permalink
Merge branch 'lukas/common_test/parallel_group_tc_fix/OTP-8921' into dev
Browse files Browse the repository at this point in the history
* lukas/common_test/parallel_group_tc_fix/OTP-8921:
  Fix bug in verification where a tc_done/start event which was generated inbetween a tc_start and tc_done of a init_per_group could caused the validation to fail
  • Loading branch information
garazdawi committed Dec 3, 2010
2 parents d40acf8 + 8e212c3 commit 74ec125
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions lib/common_test/test/ct_test_support.erl
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,33 @@ locate({parallel,TEvs}, Node, Evs, Config) ->
case Evs of
[{TEH,#event{name=tc_start,
node=Node,
data={M,{init_per_group,GroupName,Props}}}},
{TEH,#event{name=tc_done,
node=Node,
data={M,{init_per_group,GroupName,Props},R}}} | Es] ->
data={M,{init_per_group,
GroupName,Props}}}}|Es] ->
%% Use dropwhile here as a tc_done from a
%% previous testcase might sneak in here
EvsG = lists:dropwhile(
fun({EH,#event{name=tc_done,
node=EvNode,
data={EvM,{init_per_group,
EvGroupName,
EvProps},EvR}}})
when TEH == EH, EvNode == Node, EvM == M,
EvGroupName == GroupName,
EvProps == Props,
EvR == R ->
false;
({EH,#event{name=stop_logging,
node=EvNode,data=_}})
when EH == TEH, EvNode == Node ->
exit({group_init_done_not_found,
GroupName,Props});
(_) ->
true
end, Es),

test_server:format("Found ~p!", [InitStart]),
test_server:format("Found ~p!", [InitDone]),
{TEs,Es};
{TEs,EvsG};
_ ->
nomatch
end;
Expand Down

0 comments on commit 74ec125

Please sign in to comment.