diff options
author | Peter Andersson <[email protected]> | 2016-10-17 14:52:59 +0200 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2016-10-24 11:35:27 +0200 |
commit | 349c39e875e0af1bf42dcbc171a47d824401840e (patch) | |
tree | b1e73edc9b7618e2f0109d997a300608cde38a3b /lib/common_test/src/ct_run.erl | |
parent | 1550204bed17ecdcc59a53332bcdfa2ba246944a (diff) | |
download | otp-349c39e875e0af1bf42dcbc171a47d824401840e.tar.gz otp-349c39e875e0af1bf42dcbc171a47d824401840e.tar.bz2 otp-349c39e875e0af1bf42dcbc171a47d824401840e.zip |
Fix problem with printouts to incorrect parent group leader
Diffstat (limited to 'lib/common_test/src/ct_run.erl')
-rw-r--r-- | lib/common_test/src/ct_run.erl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index fbb9c7ab60..a049ef5695 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -2155,8 +2155,8 @@ continue(_MakeErrors, true) -> false; continue(_MakeErrors, _AbortIfMissingSuites) -> io:nl(), - OldGl = group_leader(), - case set_group_leader_same_as_shell() of + OldGL = group_leader(), + case set_group_leader_same_as_shell(OldGL) of true -> S = self(), io:format("Failed to compile or locate one " @@ -2172,7 +2172,7 @@ continue(_MakeErrors, _AbortIfMissingSuites) -> S ! false end end), - group_leader(OldGl, self()), + group_leader(OldGL, self()), receive R when R==true; R==false -> R after 15000 -> @@ -2184,7 +2184,9 @@ continue(_MakeErrors, _AbortIfMissingSuites) -> true end. -set_group_leader_same_as_shell() -> +set_group_leader_same_as_shell(OldGL) -> + %% find the group leader process on the node in a dirty fashion + %% (check initial function call and look in the process dictionary) GS2or3 = fun(P) -> case process_info(P,initial_call) of {initial_call,{group,server,X}} when X == 2 ; X == 3 -> @@ -2197,7 +2199,10 @@ set_group_leader_same_as_shell() -> true == lists:keymember(shell,1, element(2,process_info(P,dictionary)))] of [GL|_] -> - group_leader(GL, self()); + %% check if started from remote node (skip interaction) + if node(OldGL) /= node(GL) -> false; + true -> group_leader(GL, self()) + end; [] -> false end. |