Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common_test: fix interactive prompt #9060

Open
wants to merge 1 commit into
base: maint
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/common_test/src/common_test.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"sasl-2.5",
"snmp-5.1.2",
"ssh-4.0",
"stdlib-4.0",
"stdlib-5.0",
"syntax_tools-1.7",
"tools-3.2",
"xmerl-1.3.8"
Expand Down
23 changes: 6 additions & 17 deletions lib/common_test/src/ct_run.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2129,25 +2129,14 @@ continue(_MakeErrors, _AbortIfMissingSuites) ->
end.

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 ->
true;
_ ->
false
end
end,
case [P || P <- processes(), GS2or3(P),
true == lists:keymember(shell,1,
element(2,process_info(P,dictionary)))] of
[GL|_] ->
case shell:whereis() of
ShellPid when is_pid(ShellPid) ->
{group_leader, NewGL} = process_info(ShellPid, group_leader),
%% check if started from remote node (skip interaction)
if node(OldGL) /= node(GL) -> false;
true -> group_leader(GL, self())
if node(OldGL) /= node(NewGL) -> false;
true -> group_leader(NewGL, self())
end;
[] ->
undefined ->
false
end.

Expand Down
Loading