From 315017d4ae99e66ef9637262765c6ea9259e35b8 Mon Sep 17 00:00:00 2001
From: jmcarcell <jmcarcell@users.noreply.github.com>
Date: Tue, 23 Apr 2024 16:10:35 +0200
Subject: [PATCH 01/10] Fix the HiveSlimEventLoopMgr exit code when there is a
 failure

in the algorithms.
---
 GaudiHive/src/HiveSlimEventLoopMgr.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/GaudiHive/src/HiveSlimEventLoopMgr.cpp b/GaudiHive/src/HiveSlimEventLoopMgr.cpp
index 0657f36b84..3e1415aa7b 100644
--- a/GaudiHive/src/HiveSlimEventLoopMgr.cpp
+++ b/GaudiHive/src/HiveSlimEventLoopMgr.cpp
@@ -10,6 +10,7 @@
 \***********************************************************************************/
 // Local includes
 #include "HiveSlimEventLoopMgr.h"
+#include "GaudiKernel/StatusCode.h"
 #include "HistogramAgent.h"
 
 // Framework includes
@@ -378,6 +379,7 @@ StatusCode HiveSlimEventLoopMgr::nextEvent( int maxevt ) {
 
   uint iteration  = 0;
   auto start_time = Clock::now();
+  auto finalSC    = StatusCode::SUCCESS;
   while ( !loop_ended && ( maxevt < 0 || ( finishedEvts + skippedEvts ) < maxevt ) ) {
     DEBUG_MSG << "work loop iteration " << iteration++ << endmsg;
     // if the created events did not reach maxevt, create an event
@@ -428,7 +430,10 @@ StatusCode HiveSlimEventLoopMgr::nextEvent( int maxevt ) {
       DEBUG_MSG << "Draining the scheduler" << endmsg;
 
       // Pull out of the scheduler the finished events
-      if ( drainScheduler( finishedEvts ).isFailure() ) loop_ended = true;
+      if ( drainScheduler( finishedEvts ).isFailure() ) {
+        loop_ended = true;
+        finalSC    = StatusCode::FAILURE;
+      }
       newEvtAllowed = true;
     }
   } // end main loop on finished events
@@ -439,7 +444,7 @@ StatusCode HiveSlimEventLoopMgr::nextEvent( int maxevt ) {
          << std::chrono::duration_cast<std::chrono::nanoseconds>( end_time - start_time ).count() << endmsg;
   info() << skippedEvts << " events were SKIPed" << endmsg;
 
-  return StatusCode::SUCCESS;
+  return finalSC;
 }
 
 //---------------------------------------------------------------------------
@@ -524,7 +529,7 @@ StatusCode HiveSlimEventLoopMgr::drainScheduler( int& finishedEvts ) {
   }
 
   // Now we flush them
-  StatusCode finalSC;
+  StatusCode finalSC = StatusCode::SUCCESS;
   for ( auto& thisFinishedEvtContext : finishedEvtContexts ) {
     if ( !thisFinishedEvtContext ) {
       error() << "Detected nullptr ctxt before clearing WB!" << endmsg;
-- 
GitLab


From dddc00f02fa33ba4b4b9ce9f6fb252ef8edbc7f9 Mon Sep 17 00:00:00 2001
From: jmcarcell <jmcarcell@users.noreply.github.com>
Date: Tue, 23 Apr 2024 16:11:00 +0200
Subject: [PATCH 02/10] Add a test for the fix to HiveSlimEventLoopMgr

---
 GaudiTestSuite/options/SlimExitWithFailure.py | 42 +++++++++++++++++++
 .../slimeventloop_exit_when_failure.qmt       | 20 +++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 GaudiTestSuite/options/SlimExitWithFailure.py
 create mode 100644 GaudiTestSuite/tests/qmtest/gauditestsuite.qms/multithreading.qms/slimeventloop_exit_when_failure.qmt

diff --git a/GaudiTestSuite/options/SlimExitWithFailure.py b/GaudiTestSuite/options/SlimExitWithFailure.py
new file mode 100644
index 0000000000..5a07aa6915
--- /dev/null
+++ b/GaudiTestSuite/options/SlimExitWithFailure.py
@@ -0,0 +1,42 @@
+#####################################################################################
+# (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations #
+#                                                                                   #
+# This software is distributed under the terms of the Apache version 2 licence,     #
+# copied verbatim in the file "LICENSE".                                            #
+#                                                                                   #
+# In applying this licence, CERN does not waive the privileges and immunities       #
+# granted to it by virtue of its status as an Intergovernmental Organization        #
+# or submit itself to any jurisdiction.                                             #
+#####################################################################################
+###############################################################
+# Job options file
+# ==============================================================
+from Configurables import (
+    ApplicationMgr,
+    AvalancheSchedulerSvc,
+    GaudiExamplesCommonConf,
+    HiveSlimEventLoopMgr,
+    HiveWhiteBoard,
+)
+
+from Configurables import Gaudi__TestSuite__IntDataConsumer as IntDataConsumer
+from Gaudi.Configuration import ERROR, WARNING
+
+threads = 1
+
+GaudiExamplesCommonConf()
+
+slimeventloopmgr = HiveSlimEventLoopMgr(
+    SchedulerName="AvalancheSchedulerSvc", OutputLevel=ERROR
+)
+whiteboard = HiveWhiteBoard("EventDataSvc")
+
+scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads, OutputLevel=WARNING)
+
+ApplicationMgr(
+    TopAlg=[IntDataConsumer()],
+    EvtMax=10,
+    EvtSel="NONE",
+    EventLoop=slimeventloopmgr,
+    ExtSvc=[whiteboard],
+)
diff --git a/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/multithreading.qms/slimeventloop_exit_when_failure.qmt b/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/multithreading.qms/slimeventloop_exit_when_failure.qmt
new file mode 100644
index 0000000000..1f4b7e8bbd
--- /dev/null
+++ b/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/multithreading.qms/slimeventloop_exit_when_failure.qmt
@@ -0,0 +1,20 @@
+<?xml version="1.0" ?><!DOCTYPE extension  PUBLIC '-//QM/2.3/Extension//EN'  'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
+<!--
+    (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations
+
+    This software is distributed under the terms of the Apache version 2 licence,
+    copied verbatim in the file "LICENSE".
+
+    In applying this licence, CERN does not waive the privileges and immunities
+    granted to it by virtue of its status as an Intergovernmental Organization
+    or submit itself to any jurisdiction.
+-->
+<extension class="GaudiTest.GaudiExeTest" kind="test">
+<argument name="program"><text>gaudirun.py</text></argument>
+<argument name="args"><set>
+  <text>../../options/SlimExitWithFailure.py</text>
+</set></argument>
+<argument name="timeout"><integer>30</integer></argument>
+<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
+<argument name="exit_code"><integer>3</integer></argument>
+</extension>
-- 
GitLab


From c6ff67684c59bc153875310328feb1a68b68680d Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Tue, 23 Apr 2024 14:11:21 +0000
Subject: [PATCH 03/10] pre-commit fixes

patch generated by https://gitlab.cern.ch/jcarcell/Gaudi/-/jobs/38293090
---
 GaudiTestSuite/options/SlimExitWithFailure.py | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/GaudiTestSuite/options/SlimExitWithFailure.py b/GaudiTestSuite/options/SlimExitWithFailure.py
index 5a07aa6915..52a668436d 100644
--- a/GaudiTestSuite/options/SlimExitWithFailure.py
+++ b/GaudiTestSuite/options/SlimExitWithFailure.py
@@ -11,15 +11,9 @@
 ###############################################################
 # Job options file
 # ==============================================================
-from Configurables import (
-    ApplicationMgr,
-    AvalancheSchedulerSvc,
-    GaudiExamplesCommonConf,
-    HiveSlimEventLoopMgr,
-    HiveWhiteBoard,
-)
-
+from Configurables import ApplicationMgr, AvalancheSchedulerSvc
 from Configurables import Gaudi__TestSuite__IntDataConsumer as IntDataConsumer
+from Configurables import GaudiExamplesCommonConf, HiveSlimEventLoopMgr, HiveWhiteBoard
 from Gaudi.Configuration import ERROR, WARNING
 
 threads = 1
-- 
GitLab


From bf06d42f4ca1e836a8388a974d724c2e3e5cc8f5 Mon Sep 17 00:00:00 2001
From: jmcarcell <jmcarcell@users.noreply.github.com>
Date: Tue, 23 Apr 2024 16:25:56 +0200
Subject: [PATCH 04/10] Use the default values (SUCCESS)

---
 GaudiHive/src/HiveSlimEventLoopMgr.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/GaudiHive/src/HiveSlimEventLoopMgr.cpp b/GaudiHive/src/HiveSlimEventLoopMgr.cpp
index 3e1415aa7b..836e25ffda 100644
--- a/GaudiHive/src/HiveSlimEventLoopMgr.cpp
+++ b/GaudiHive/src/HiveSlimEventLoopMgr.cpp
@@ -379,7 +379,7 @@ StatusCode HiveSlimEventLoopMgr::nextEvent( int maxevt ) {
 
   uint iteration  = 0;
   auto start_time = Clock::now();
-  auto finalSC    = StatusCode::SUCCESS;
+  StatusCode finalSC;
   while ( !loop_ended && ( maxevt < 0 || ( finishedEvts + skippedEvts ) < maxevt ) ) {
     DEBUG_MSG << "work loop iteration " << iteration++ << endmsg;
     // if the created events did not reach maxevt, create an event
@@ -529,7 +529,7 @@ StatusCode HiveSlimEventLoopMgr::drainScheduler( int& finishedEvts ) {
   }
 
   // Now we flush them
-  StatusCode finalSC = StatusCode::SUCCESS;
+  StatusCode finalSC;
   for ( auto& thisFinishedEvtContext : finishedEvtContexts ) {
     if ( !thisFinishedEvtContext ) {
       error() << "Detected nullptr ctxt before clearing WB!" << endmsg;
-- 
GitLab


From 1eeb170185ca698e103519dde35b796556e0d223 Mon Sep 17 00:00:00 2001
From: jmcarcell <jmcarcell@users.noreply.github.com>
Date: Tue, 23 Apr 2024 20:49:06 +0200
Subject: [PATCH 05/10] Fix tests

---
 .../gaudihive.qms/avalanche_scheduler.qms/conditions_stall.qmt  | 1 +
 .../gaudihive.qms/avalanche_scheduler.qms/detect_stall.qmt      | 1 +
 .../avalanche_scheduler.qms/view_data_isolation_test.qmt        | 1 +
 GaudiHive/tests/qmtest/refs/SubSlotVsSlotIsolation.ref          | 2 +-
 .../qmtest/gauditestsuite.qms/control_flow.qms/toolhandles.qmt  | 1 +
 .../multithreading.qms/slimeventloop_exit_when_failure.qmt      | 2 +-
 GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref                | 2 +-
 7 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/GaudiHive/tests/qmtest/gaudihive.qms/avalanche_scheduler.qms/conditions_stall.qmt b/GaudiHive/tests/qmtest/gaudihive.qms/avalanche_scheduler.qms/conditions_stall.qmt
index 1301369ace..082990de70 100644
--- a/GaudiHive/tests/qmtest/gaudihive.qms/avalanche_scheduler.qms/conditions_stall.qmt
+++ b/GaudiHive/tests/qmtest/gaudihive.qms/avalanche_scheduler.qms/conditions_stall.qmt
@@ -19,4 +19,5 @@ if stdout.find(expected_string) == -1:
     result[&apos;GaudiTest.expected_string&apos;] = result.Quote(expected_string)
 </text></argument>
 <argument name="timeout"><integer>60</integer></argument>
++<argument name="exit_code"><integer>1</integer></argument>
 </extension>
diff --git a/GaudiHive/tests/qmtest/gaudihive.qms/avalanche_scheduler.qms/detect_stall.qmt b/GaudiHive/tests/qmtest/gaudihive.qms/avalanche_scheduler.qms/detect_stall.qmt
index 2361423638..9326fd234f 100644
--- a/GaudiHive/tests/qmtest/gaudihive.qms/avalanche_scheduler.qms/detect_stall.qmt
+++ b/GaudiHive/tests/qmtest/gaudihive.qms/avalanche_scheduler.qms/detect_stall.qmt
@@ -19,4 +19,5 @@ if stdout.find(expected_string) == -1:
     result[&apos;GaudiTest.expected_string&apos;] = result.Quote(expected_string)
 </text></argument>
 <argument name="timeout"><integer>60</integer></argument>
++<argument name="exit_code"><integer>1</integer></argument>
 </extension>
diff --git a/GaudiHive/tests/qmtest/gaudihive.qms/avalanche_scheduler.qms/view_data_isolation_test.qmt b/GaudiHive/tests/qmtest/gaudihive.qms/avalanche_scheduler.qms/view_data_isolation_test.qmt
index 64470b5527..dec7a4c58c 100644
--- a/GaudiHive/tests/qmtest/gaudihive.qms/avalanche_scheduler.qms/view_data_isolation_test.qmt
+++ b/GaudiHive/tests/qmtest/gaudihive.qms/avalanche_scheduler.qms/view_data_isolation_test.qmt
@@ -18,6 +18,7 @@
 <argument name="use_temp_dir"><enumeral>true</enumeral></argument>
 <argument name="timeout"><integer>120</integer></argument>
 <argument name="reference"><text>refs/SubSlotVsSlotIsolation.ref</text></argument>
+<argument name="exit_code"><integer>1</integer></argument>
 <argument name="environment"><set>
 <text>GAUDIAPPNAME=</text>
 <text>GAUDIAPPVERSION=</text>
diff --git a/GaudiHive/tests/qmtest/refs/SubSlotVsSlotIsolation.ref b/GaudiHive/tests/qmtest/refs/SubSlotVsSlotIsolation.ref
index 924078688d..f30752d994 100644
--- a/GaudiHive/tests/qmtest/refs/SubSlotVsSlotIsolation.ref
+++ b/GaudiHive/tests/qmtest/refs/SubSlotVsSlotIsolation.ref
@@ -244,4 +244,4 @@ ApplicationMgr       INFO Application Manager Stopped successfully
 HiveSlimEventLo...   INFO Histograms converted successfully according to request.
 AvalancheSchedu...   INFO Joining Scheduler thread
 ApplicationMgr       INFO Application Manager Finalized successfully
-ApplicationMgr       INFO Application Manager Terminated successfully
+ApplicationMgr      ERROR Application Manager Terminated with error code 1
\ No newline at end of file
diff --git a/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/control_flow.qms/toolhandles.qmt b/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/control_flow.qms/toolhandles.qmt
index 7d63253826..62d2d76951 100644
--- a/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/control_flow.qms/toolhandles.qmt
+++ b/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/control_flow.qms/toolhandles.qmt
@@ -13,4 +13,5 @@
 <argument name="program"><text>gaudirun.py</text></argument>
 <argument name="args"><set><text>../../options/ToolHandles.py</text></set></argument>
 <argument name="reference"><text>refs/ToolHandles.ref</text></argument>
+<argument name="exit_code"><integer>1</integer></argument>
 </extension>
diff --git a/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/multithreading.qms/slimeventloop_exit_when_failure.qmt b/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/multithreading.qms/slimeventloop_exit_when_failure.qmt
index 1f4b7e8bbd..9cd6f93374 100644
--- a/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/multithreading.qms/slimeventloop_exit_when_failure.qmt
+++ b/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/multithreading.qms/slimeventloop_exit_when_failure.qmt
@@ -16,5 +16,5 @@
 </set></argument>
 <argument name="timeout"><integer>30</integer></argument>
 <argument name="use_temp_dir"><enumeral>true</enumeral></argument>
-<argument name="exit_code"><integer>3</integer></argument>
+<argument name="exit_code"><integer>1</integer></argument>
 </extension>
diff --git a/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref b/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref
index 42e8248a30..e80fc33855 100644
--- a/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref
+++ b/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref
@@ -61,4 +61,4 @@ HiveSlimEventLo...   INFO Histograms converted successfully according to request
 AvalancheSchedu...   INFO Joining Scheduler thread
 ToolSvc              INFO Removing all tools created by ToolSvc
 ApplicationMgr       INFO Application Manager Finalized successfully
-ApplicationMgr       INFO Application Manager Terminated successfully
+ApplicationMgr      ERROR Application Manager Terminated with error code 1
-- 
GitLab


From 990ddd8f2efee85cd070c81d6f2aa89800db897b Mon Sep 17 00:00:00 2001
From: jmcarcell <jmcarcell@users.noreply.github.com>
Date: Tue, 23 Apr 2024 20:52:40 +0200
Subject: [PATCH 06/10] Fix style

---
 GaudiHive/src/HiveSlimEventLoopMgr.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/GaudiHive/src/HiveSlimEventLoopMgr.cpp b/GaudiHive/src/HiveSlimEventLoopMgr.cpp
index 836e25ffda..2e14a5977e 100644
--- a/GaudiHive/src/HiveSlimEventLoopMgr.cpp
+++ b/GaudiHive/src/HiveSlimEventLoopMgr.cpp
@@ -377,8 +377,8 @@ StatusCode HiveSlimEventLoopMgr::nextEvent( int maxevt ) {
 
   constexpr double oneOver1024 = 1. / 1024.;
 
-  uint iteration  = 0;
-  auto start_time = Clock::now();
+  uint       iteration  = 0;
+  auto       start_time = Clock::now();
   StatusCode finalSC;
   while ( !loop_ended && ( maxevt < 0 || ( finishedEvts + skippedEvts ) < maxevt ) ) {
     DEBUG_MSG << "work loop iteration " << iteration++ << endmsg;
-- 
GitLab


From abf264bb5d43bc1ab7f734f0f15bad6d895734ae Mon Sep 17 00:00:00 2001
From: jmcarcell <jmcarcell@users.noreply.github.com>
Date: Tue, 23 Apr 2024 21:10:15 +0200
Subject: [PATCH 07/10] Fix style

---
 GaudiHive/tests/qmtest/refs/SubSlotVsSlotIsolation.ref | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/GaudiHive/tests/qmtest/refs/SubSlotVsSlotIsolation.ref b/GaudiHive/tests/qmtest/refs/SubSlotVsSlotIsolation.ref
index f30752d994..92e31ff76d 100644
--- a/GaudiHive/tests/qmtest/refs/SubSlotVsSlotIsolation.ref
+++ b/GaudiHive/tests/qmtest/refs/SubSlotVsSlotIsolation.ref
@@ -244,4 +244,4 @@ ApplicationMgr       INFO Application Manager Stopped successfully
 HiveSlimEventLo...   INFO Histograms converted successfully according to request.
 AvalancheSchedu...   INFO Joining Scheduler thread
 ApplicationMgr       INFO Application Manager Finalized successfully
-ApplicationMgr      ERROR Application Manager Terminated with error code 1
\ No newline at end of file
+ApplicationMgr      ERROR Application Manager Terminated with error code 1
-- 
GitLab


From 10e3411f6b142b3d59a08110684bd6dac0806dba Mon Sep 17 00:00:00 2001
From: jmcarcell <jmcarcell@users.noreply.github.com>
Date: Sun, 12 May 2024 15:31:35 +0200
Subject: [PATCH 08/10] Fix the ToolHandles.py test by not having an event
 selector

---
 GaudiTestSuite/options/ToolHandles.py         | 12 +++----
 .../control_flow.qms/toolhandles.qmt          |  2 +-
 .../tests/qmtest/refs/ToolHandles.ref         | 32 ++++---------------
 3 files changed, 12 insertions(+), 34 deletions(-)

diff --git a/GaudiTestSuite/options/ToolHandles.py b/GaudiTestSuite/options/ToolHandles.py
index e978f6a51d..550b983adc 100644
--- a/GaudiTestSuite/options/ToolHandles.py
+++ b/GaudiTestSuite/options/ToolHandles.py
@@ -22,14 +22,12 @@ scheduler = AvalancheSchedulerSvc(ThreadPoolSize=2)
 
 # - Algorithms
 topalgs = [
-    THDataProducer("THDataProducer", OutputLevel=DEBUG),
-    THDataProducer2("THDataProducer2", OutputLevel=DEBUG),
-    THDataConsumer("THDataConsumer", OutputLevel=DEBUG),
+    THDataProducer("THDataProducer", OutputLevel=ERROR),
+    THDataProducer2("THDataProducer2", OutputLevel=ERROR),
+    THDataConsumer("THDataConsumer", OutputLevel=ERROR),
 ]
 
-topalgs[-1].FloatTool.OutputLevel = INFO
-
 # Application manager
 app = ApplicationMgr(
-    EvtMax=4, ExtSvc=[whiteboard], EventLoop=slimeventloopmgr, TopAlg=topalgs
-)
+    EvtMax=4, ExtSvc=[whiteboard], EventLoop=slimeventloopmgr, TopAlg=topalgs,
+    EvtSel="NONE")
diff --git a/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/control_flow.qms/toolhandles.qmt b/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/control_flow.qms/toolhandles.qmt
index 62d2d76951..ddccdffc0b 100644
--- a/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/control_flow.qms/toolhandles.qmt
+++ b/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/control_flow.qms/toolhandles.qmt
@@ -13,5 +13,5 @@
 <argument name="program"><text>gaudirun.py</text></argument>
 <argument name="args"><set><text>../../options/ToolHandles.py</text></set></argument>
 <argument name="reference"><text>refs/ToolHandles.ref</text></argument>
-<argument name="exit_code"><integer>1</integer></argument>
+<argument name="exit_code"><integer>0</integer></argument>
 </extension>
diff --git a/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref b/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref
index e80fc33855..370ba93f79 100644
--- a/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref
+++ b/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref
@@ -3,31 +3,13 @@
 # <-- End of file '/build/Gaudi/GaudiTestSuite/options/ToolHandles.py'
 ApplicationMgr    SUCCESS
 ====================================================================================================================================
-                                                   Welcome to main version 36.12
-                                          running on build-host.cern.ch on Wed Mar 29 18:41:34 2023
+                                                                                         Welcome to ApplicationMgr (GaudiCoreSvc v38r2)
+                                          running on pc on Sun May 12 15:28:32 2024
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 ThreadPoolSvc        INFO no thread init tools attached
 AvalancheSchedu...   INFO Activating scheduler in a separate thread
 AlgResourcePool      INFO TopAlg list empty. Recovering the one of Application Manager
-THDataProducer      DEBUG Property update for OutputLevel : new value = 2
-THDataProducer      DEBUG input handles: 0
-THDataProducer      DEBUG output handles: 1
-THDataProducer      DEBUG data dependencies:
-  + OUTPUT '/Event/MyInt'
-THDataProducer2     DEBUG Property update for OutputLevel : new value = 2
-THDataProducer2     DEBUG input handles: 0
-THDataProducer2     DEBUG output handles: 1
-THDataProducer2     DEBUG data dependencies:
-  + OUTPUT '/Event/MyFloat'
-THDataConsumer      DEBUG Property update for OutputLevel : new value = 2
-THDataConsumer      DEBUG input handles: 1
-THDataConsumer      DEBUG output handles: 0
-THDataConsumer....  DEBUG Property update for OutputLevel : new value = 2
-THDataConsumer      DEBUG Adding private ToolHandle tool THDataConsumer.Gaudi::TestSuite::FloatTool (Gaudi::TestSuite::FloatTool)
-THDataConsumer      DEBUG data dependencies:
-  + INPUT  '/Event/MyFloat' [THDataConsumer.Gaudi::TestSuite::FloatTool]
-  + INPUT  '/Event/MyInt'
 AvalancheSchedu...   INFO Found 3 algorithms
 AvalancheSchedu...   INFO Data Dependencies for Algorithms:
   THDataProducer
@@ -46,19 +28,17 @@ AvalancheSchedu...   INFO Task scheduling settings:
 AvalancheSchedu...   INFO  o Avalanche generation mode: disabled
 AvalancheSchedu...   INFO  o Preemptive scheduling of CPU-blocking tasks: disabled
 AvalancheSchedu...   INFO  o Scheduling of condition tasks: disabled
+HiveSlimEventLo...WARNING Unable to locate service "EventSelector"
+HiveSlimEventLo...WARNING No events will be processed from external input.
 HiveSlimEventLo...   INFO Found 0 events in black list
 ApplicationMgr       INFO Application Manager Initialized successfully
-JobOptionsSvc        INFO Properties are dumped into "gauditestsuite.control_flow.toolhandles.joboptsdump"
 ApplicationMgr       INFO Application Manager Started successfully
 HiveSlimEventLo...   INFO Starting loop on events
-EventSelector        INFO End of event input reached.
-HiveSlimEventLo...   INFO No more events in event selection
-HiveSlimEventLo...  ERROR Detected nullptr ctxt before clearing WB!
-HiveSlimEventLo...   INFO ---> Loop Finished (skipping 1st evt) -  WSS 262.766 total time 39910
+HiveSlimEventLo...   INFO ---> Loop Finished (skipping 1st evt) -  WSS 306.566 total time 56431
 HiveSlimEventLo...   INFO 0 events were SKIPed
 ApplicationMgr       INFO Application Manager Stopped successfully
 HiveSlimEventLo...   INFO Histograms converted successfully according to request.
 AvalancheSchedu...   INFO Joining Scheduler thread
 ToolSvc              INFO Removing all tools created by ToolSvc
 ApplicationMgr       INFO Application Manager Finalized successfully
-ApplicationMgr      ERROR Application Manager Terminated with error code 1
+ApplicationMgr       INFO Application Manager Terminated successfully
\ No newline at end of file
-- 
GitLab


From 2ed6ea598a1527377ed0474c8bac1701d3a0cbc0 Mon Sep 17 00:00:00 2001
From: jmcarcell <jmcarcell@users.noreply.github.com>
Date: Sun, 12 May 2024 15:33:09 +0200
Subject: [PATCH 09/10] Fix style

---
 GaudiTestSuite/options/ToolHandles.py            | 8 ++++++--
 GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/GaudiTestSuite/options/ToolHandles.py b/GaudiTestSuite/options/ToolHandles.py
index 550b983adc..703cc7d816 100644
--- a/GaudiTestSuite/options/ToolHandles.py
+++ b/GaudiTestSuite/options/ToolHandles.py
@@ -29,5 +29,9 @@ topalgs = [
 
 # Application manager
 app = ApplicationMgr(
-    EvtMax=4, ExtSvc=[whiteboard], EventLoop=slimeventloopmgr, TopAlg=topalgs,
-    EvtSel="NONE")
+    EvtMax=4,
+    ExtSvc=[whiteboard],
+    EventLoop=slimeventloopmgr,
+    TopAlg=topalgs,
+    EvtSel="NONE",
+)
diff --git a/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref b/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref
index 370ba93f79..3f220773c6 100644
--- a/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref
+++ b/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref
@@ -41,4 +41,4 @@ HiveSlimEventLo...   INFO Histograms converted successfully according to request
 AvalancheSchedu...   INFO Joining Scheduler thread
 ToolSvc              INFO Removing all tools created by ToolSvc
 ApplicationMgr       INFO Application Manager Finalized successfully
-ApplicationMgr       INFO Application Manager Terminated successfully
\ No newline at end of file
+ApplicationMgr       INFO Application Manager Terminated successfully
-- 
GitLab


From 3356460d2cc440e196ef2c264d79aa367fcea91a Mon Sep 17 00:00:00 2001
From: Marco Clemencic <marco.clemencic@cern.ch>
Date: Tue, 14 May 2024 12:44:06 +0200
Subject: [PATCH 10/10] restore printout in control_flow.toolhandles test

---
 GaudiTestSuite/options/ToolHandles.py         | 10 +++--
 .../control_flow.qms/toolhandles.qmt          |  7 +++-
 .../tests/qmtest/refs/ToolHandles.ref         | 38 +++++++++++++++++--
 3 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/GaudiTestSuite/options/ToolHandles.py b/GaudiTestSuite/options/ToolHandles.py
index 703cc7d816..ecb4366fd1 100644
--- a/GaudiTestSuite/options/ToolHandles.py
+++ b/GaudiTestSuite/options/ToolHandles.py
@@ -1,5 +1,5 @@
 #####################################################################################
-# (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations #
+# (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations #
 #                                                                                   #
 # This software is distributed under the terms of the Apache version 2 licence,     #
 # copied verbatim in the file "LICENSE".                                            #
@@ -22,11 +22,13 @@ scheduler = AvalancheSchedulerSvc(ThreadPoolSize=2)
 
 # - Algorithms
 topalgs = [
-    THDataProducer("THDataProducer", OutputLevel=ERROR),
-    THDataProducer2("THDataProducer2", OutputLevel=ERROR),
-    THDataConsumer("THDataConsumer", OutputLevel=ERROR),
+    THDataProducer("THDataProducer", OutputLevel=DEBUG),
+    THDataProducer2("THDataProducer2", OutputLevel=DEBUG),
+    THDataConsumer("THDataConsumer", OutputLevel=DEBUG),
 ]
 
+topalgs[-1].FloatTool.OutputLevel = INFO
+
 # Application manager
 app = ApplicationMgr(
     EvtMax=4,
diff --git a/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/control_flow.qms/toolhandles.qmt b/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/control_flow.qms/toolhandles.qmt
index ddccdffc0b..b746c7c433 100644
--- a/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/control_flow.qms/toolhandles.qmt
+++ b/GaudiTestSuite/tests/qmtest/gauditestsuite.qms/control_flow.qms/toolhandles.qmt
@@ -1,6 +1,6 @@
 <?xml version="1.0" ?><!DOCTYPE extension  PUBLIC '-//QM/2.3/Extension//EN'  'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
 <!--
-    (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations
+    (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations
 
     This software is distributed under the terms of the Apache version 2 licence,
     copied verbatim in the file "LICENSE".
@@ -14,4 +14,9 @@
 <argument name="args"><set><text>../../options/ToolHandles.py</text></set></argument>
 <argument name="reference"><text>refs/ToolHandles.ref</text></argument>
 <argument name="exit_code"><integer>0</integer></argument>
+<argument name="validator"><text>
+# ignore order of lines printed during execution
+preprocessor = normalizeTestSuite + SortGroupOfLines(r"^THData.*INFO executing")
+validateWithReference(preproc = preprocessor)
+</text></argument>
 </extension>
diff --git a/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref b/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref
index 3f220773c6..8b509d97a6 100644
--- a/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref
+++ b/GaudiTestSuite/tests/qmtest/refs/ToolHandles.ref
@@ -1,15 +1,33 @@
 # setting LC_ALL to "C"
-# --> Including file '/build/Gaudi/GaudiTestSuite/options/ToolHandles.py'
-# <-- End of file '/build/Gaudi/GaudiTestSuite/options/ToolHandles.py'
+# --> Including file '/home/marcocle/stacks/master/Gaudi/GaudiTestSuite/options/ToolHandles.py'
+# <-- End of file '/home/marcocle/stacks/master/Gaudi/GaudiTestSuite/options/ToolHandles.py'
 ApplicationMgr    SUCCESS
 ====================================================================================================================================
-                                                                                         Welcome to ApplicationMgr (GaudiCoreSvc v38r2)
-                                          running on pc on Sun May 12 15:28:32 2024
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v38r2)
+                                          running on lbbuildinter01.cern.ch on Tue May 14 12:32:33 2024
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 ThreadPoolSvc        INFO no thread init tools attached
 AvalancheSchedu...   INFO Activating scheduler in a separate thread
 AlgResourcePool      INFO TopAlg list empty. Recovering the one of Application Manager
+THDataProducer      DEBUG Property update for OutputLevel : new value = 2
+THDataProducer      DEBUG input handles: 0
+THDataProducer      DEBUG output handles: 1
+THDataProducer      DEBUG data dependencies:
+  + OUTPUT '/Event/MyInt'
+THDataProducer2     DEBUG Property update for OutputLevel : new value = 2
+THDataProducer2     DEBUG input handles: 0
+THDataProducer2     DEBUG output handles: 1
+THDataProducer2     DEBUG data dependencies:
+  + OUTPUT '/Event/MyFloat'
+THDataConsumer      DEBUG Property update for OutputLevel : new value = 2
+THDataConsumer      DEBUG input handles: 1
+THDataConsumer      DEBUG output handles: 0
+THDataConsumer....  DEBUG Property update for OutputLevel : new value = 2
+THDataConsumer      DEBUG Adding private ToolHandle tool THDataConsumer.Gaudi::TestSuite::FloatTool (Gaudi::TestSuite::FloatTool)
+THDataConsumer      DEBUG data dependencies:
+  + INPUT  '/Event/MyFloat' [THDataConsumer.Gaudi::TestSuite::FloatTool]
+  + INPUT  '/Event/MyInt'
 AvalancheSchedu...   INFO Found 3 algorithms
 AvalancheSchedu...   INFO Data Dependencies for Algorithms:
   THDataProducer
@@ -34,6 +52,18 @@ HiveSlimEventLo...   INFO Found 0 events in black list
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr       INFO Application Manager Started successfully
 HiveSlimEventLo...   INFO Starting loop on events
+THDataProducer       INFO executing IntDataProducer, storing 7 into /Event/MyInt
+THDataProducer2      INFO executing IntDataProducer, storing 7.0 into /Event/MyFloat
+THDataConsumer       INFO executing IntDataConsumer, checking 7 from /Event/MyInt and 7 from FloatTool are matching
+THDataProducer       INFO executing IntDataProducer, storing 7 into /Event/MyInt
+THDataProducer2      INFO executing IntDataProducer, storing 7.0 into /Event/MyFloat
+THDataProducer2      INFO executing IntDataProducer, storing 7.0 into /Event/MyFloat
+THDataProducer       INFO executing IntDataProducer, storing 7 into /Event/MyInt
+THDataConsumer       INFO executing IntDataConsumer, checking 7 from /Event/MyInt and 7 from FloatTool are matching
+THDataConsumer       INFO executing IntDataConsumer, checking 7 from /Event/MyInt and 7 from FloatTool are matching
+THDataProducer       INFO executing IntDataProducer, storing 7 into /Event/MyInt
+THDataProducer2      INFO executing IntDataProducer, storing 7.0 into /Event/MyFloat
+THDataConsumer       INFO executing IntDataConsumer, checking 7 from /Event/MyInt and 7 from FloatTool are matching
 HiveSlimEventLo...   INFO ---> Loop Finished (skipping 1st evt) -  WSS 306.566 total time 56431
 HiveSlimEventLo...   INFO 0 events were SKIPed
 ApplicationMgr       INFO Application Manager Stopped successfully
-- 
GitLab