From 90c074e81e2412b2018f7c812bbb0646508f4b78 Mon Sep 17 00:00:00 2001 From: Jakub Witczak Date: Tue, 12 Nov 2024 18:00:19 +0100 Subject: [PATCH] common_test: fix interactive prompt - fix prompt for failed test code compilation case --- lib/common_test/src/common_test.app.src | 2 +- lib/common_test/src/ct_run.erl | 23 ++++++----------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/lib/common_test/src/common_test.app.src b/lib/common_test/src/common_test.app.src index fd7025937f42..44fcac6c5cf0 100644 --- a/lib/common_test/src/common_test.app.src +++ b/lib/common_test/src/common_test.app.src @@ -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" diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index 71d7f6092c85..599413a9b777 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -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.