aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2010-12-03 10:30:10 +0100
committerLukas Larsson <[email protected]>2010-12-03 10:30:10 +0100
commit74ec1253e1a89f0bb266831f73716a24c0798dc1 (patch)
tree88acff5616132430503112eec26340292947e40b /lib
parentd40acf85c51ab495cd5cc0b8109bfc8e55b3d73a (diff)
parent8e212c3a3f3d878a9fb8db9b82099ac5f6ac3d6f (diff)
downloadotp-74ec1253e1a89f0bb266831f73716a24c0798dc1.tar.gz
otp-74ec1253e1a89f0bb266831f73716a24c0798dc1.tar.bz2
otp-74ec1253e1a89f0bb266831f73716a24c0798dc1.zip
Merge branch 'lukas/common_test/parallel_group_tc_fix/OTP-8921' into dev
* 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
Diffstat (limited to 'lib')
-rw-r--r--lib/common_test/test/ct_test_support.erl30
1 files changed, 25 insertions, 5 deletions
diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl
index 7bfb9ffb49..b0c98e7f7f 100644
--- a/lib/common_test/test/ct_test_support.erl
+++ b/lib/common_test/test/ct_test_support.erl
@@ -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;