From 0c4810c5efeacf688b8fafd04f23da54ed1f5b3c Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Wed, 14 Feb 2024 15:51:36 +0100
Subject: [PATCH] properly handle exit codes

---
 .../DatabaseTest/AthenaPoolTest/python/EventInfoRead.py      | 5 ++---
 .../DatabaseTest/AthenaPoolTest/python/EventInfoReadWrite.py | 5 ++---
 .../DatabaseTest/AthenaPoolTest/python/EventInfoWrite.py     | 3 ++-
 .../AthenaPoolTest/python/EventInfoWriteStep2.py             | 3 ++-
 .../AthenaPoolTest/python/EventInfoWriteStep3.py             | 3 ++-
 .../AthenaPoolTest/python/EventInfoWriteStep4.py             | 3 ++-
 .../AthenaPoolTest/python/EventInfoWriteStep5.py             | 3 ++-
 7 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoRead.py b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoRead.py
index 9e0a61f01f81..1f5a6dc1e142 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoRead.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoRead.py
@@ -3,9 +3,8 @@
 
 from AthenaConfiguration.AllConfigFlags import initConfigFlags
 from AthenaConfiguration.ComponentFactory import CompFactory
-#from AthenaConfiguration.TestDefaults import defaultGeometryTags
 from AthenaConfiguration.Utils import setupLoggingLevels
-
+import sys
 
 flags=initConfigFlags()
 #Set a number of flags to avoid input-file peeking
@@ -52,4 +51,4 @@ acc.getService("GeoModelSvc").IgnoreTagDifference = True
 
 setupLoggingLevels(flags,acc)
 
-acc.run()
+sys.exit(acc.run().isFailure())
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoReadWrite.py b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoReadWrite.py
index e3cebdb6a730..d074ccfe2a74 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoReadWrite.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoReadWrite.py
@@ -3,7 +3,6 @@
 
 from AthenaConfiguration.AllConfigFlags import initConfigFlags
 from AthenaConfiguration.ComponentFactory import CompFactory
-#from AthenaConfiguration.TestDefaults import defaultGeometryTags
 from AthenaConfiguration.Utils import setupLoggingLevels
 
 def eventInfoTestCfg(step=1):
@@ -63,9 +62,9 @@ def eventInfoTestCfg(step=1):
     # Change output file catalog to avoid races.
     acc.getService("PoolSvc").WriteCatalog = 'file:EventInfoTests_catalog.xml'
 
-    #Tag differnces are intentional here
+    #Tag differences are intentional here
     acc.getService("GeoModelSvc").IgnoreTagDifference = True 
 
     setupLoggingLevels(flags,acc)
 
-    acc.run()
+    return acc.run().isFailure()
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWrite.py b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWrite.py
index cd8f11bc5cba..b00ba9f35c4e 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWrite.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWrite.py
@@ -6,6 +6,7 @@ from AthenaConfiguration.ComponentFactory import CompFactory
 from AthenaConfiguration.TestDefaults import defaultGeometryTags
 from AthenaConfiguration.Utils import setupLoggingLevels
 from Campaigns.Utils import Campaign
+import sys
 
 #Set a number of flags to avoid input-file peeking
 flags=initConfigFlags()
@@ -65,4 +66,4 @@ acc.getService("PoolSvc").WriteCatalog = 'file:EventInfoTests_catalog.xml'
 
 setupLoggingLevels(flags,acc)
 
-acc.run(25)
+sys.exit(acc.run(25).isFailure())
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep2.py b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep2.py
index 5b9b08e261e6..a5494f55784a 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep2.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep2.py
@@ -1,5 +1,6 @@
 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
 
 from AthenaPoolTest.EventInfoReadWrite import eventInfoTestCfg
+import sys
 
-eventInfoTestCfg(2)
+sys.exit(eventInfoTestCfg(2))
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep3.py b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep3.py
index 98a976a43313..59d709959f99 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep3.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep3.py
@@ -1,5 +1,6 @@
 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
 
 from AthenaPoolTest.EventInfoReadWrite import eventInfoTestCfg
+import sys
 
-eventInfoTestCfg(3)
+sys.exit(eventInfoTestCfg(3))
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep4.py b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep4.py
index 2f9222f89d24..9736e746212d 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep4.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep4.py
@@ -1,5 +1,6 @@
 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
 
 from AthenaPoolTest.EventInfoReadWrite import eventInfoTestCfg
+import sys
 
-eventInfoTestCfg(4)
+sys.exit(eventInfoTestCfg(4))
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep5.py b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep5.py
index 6f6ab73bae9c..dba1aae6bd23 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep5.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/python/EventInfoWriteStep5.py
@@ -1,5 +1,6 @@
 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
 
 from AthenaPoolTest.EventInfoReadWrite import eventInfoTestCfg
+import sys
 
-eventInfoTestCfg(5)
+sys.exit(eventInfoTestCfg(5))
-- 
GitLab