diff options
author | Lukas Larsson <[email protected]> | 2010-12-02 13:51:37 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2010-12-03 10:20:47 +0100 |
commit | 8e212c3a3f3d878a9fb8db9b82099ac5f6ac3d6f (patch) | |
tree | d8e8ac0705704667fc3b7853497769fe2f778ba2 | |
parent | d9a508b6ca18ce3bf76563c89bf452e74fa65d45 (diff) | |
download | otp-8e212c3a3f3d878a9fb8db9b82099ac5f6ac3d6f.tar.gz otp-8e212c3a3f3d878a9fb8db9b82099ac5f6ac3d6f.tar.bz2 otp-8e212c3a3f3d878a9fb8db9b82099ac5f6ac3d6f.zip |
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
-rw-r--r-- | lib/common_test/test/ct_test_support.erl | 30 |
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; |