aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_framework.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2014-05-02 11:00:26 +0200
committerPeter Andersson <[email protected]>2014-05-02 11:00:26 +0200
commit43fe944a466c47cca84cc4b02371004847927355 (patch)
tree148a5071a0d882d14261710a8c806d324bc334b8 /lib/common_test/src/ct_framework.erl
parent10f47281bf94e7e3ed98f97f3c1531036edce9cc (diff)
parentaf8a352109ba87f7960ab46bd6ed1d237b87ed7c (diff)
downloadotp-43fe944a466c47cca84cc4b02371004847927355.tar.gz
otp-43fe944a466c47cca84cc4b02371004847927355.tar.bz2
otp-43fe944a466c47cca84cc4b02371004847927355.zip
Merge remote branch 'origin/peppe/common_test/ct_comment_problem' into maint
* origin/peppe/common_test/ct_comment_problem: Fix problem with comments getting lost when running parallel test cases
Diffstat (limited to 'lib/common_test/src/ct_framework.erl')
-rw-r--r--lib/common_test/src/ct_framework.erl15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index 9ef917a507..20903607dc 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -657,7 +657,18 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) ->
_ ->
ok
end,
- ct_util:delete_testdata(comment),
+ if Func == end_per_group; Func == end_per_suite ->
+ %% clean up any saved comments
+ ct_util:match_delete_testdata({comment,'_'});
+ true ->
+ %% attemp to delete any saved comment for this TC
+ case process_info(TCPid, group_leader) of
+ {group_leader,TCGL} ->
+ ct_util:delete_testdata({comment,TCGL});
+ _ ->
+ ok
+ end
+ end,
ct_util:delete_suite_data(last_saved_config),
FuncSpec = group_or_func(Func,Args),
@@ -850,7 +861,7 @@ error_notification(Mod,Func,_Args,{Error,Loc}) ->
_ ->
%% this notification comes from the test case process, so
%% we can add error info to comment with test_server:comment/1
- case ct_util:get_testdata(comment) of
+ case ct_util:get_testdata({comment,group_leader()}) of
undefined ->
test_server:comment(ErrorHtml);
Comment ->