From ad28d8eb99e6e61730b1cf57e5b460cce5fa5ff1 Mon Sep 17 00:00:00 2001
From: P-A Loizeau <p.-a.loizeau@gsi.de>
Date: Thu, 11 Apr 2024 17:02:37 +0200
Subject: [PATCH] [CDASH] Try to fix CET/CEST in script finding job end time

---
 scripts/find_slurm_ctest_stop_time.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/find_slurm_ctest_stop_time.sh b/scripts/find_slurm_ctest_stop_time.sh
index c450f17a1a..2f1e7bb17e 100755
--- a/scripts/find_slurm_ctest_stop_time.sh
+++ b/scripts/find_slurm_ctest_stop_time.sh
@@ -20,7 +20,8 @@
 
 # SLURM end time
 END_TIME=`squeue -j ${SLURM_JOB_ID} -h --Format EndTime`
-echo "SLURM Job end time ${END_TIME}"
+CET_CEST=`date +"%Z"`
+echo "SLURM Job end time ${END_TIME} probably ${CET_CEST}"
 
 # Ctest end time = SLURM -5 minutes (should be enough for coverage and uploads)
 # => Not working as ctest expects the "time point in hours-minutes-seconds within current day"
@@ -36,7 +37,8 @@ echo "SLURM Job end time ${END_TIME}"
 #    (tried all timezone options of date, with and without space between time and timezone)
 #CTEST_END_TIME_LIMIT=`date -d "${END_TIME}CET -5minutes" +"%H:%M:%S %z"`
 # => Working! but probably unsafe on day of Summer time swaps + if tests run close to midnight...
-CTEST_END_TIME_LIMIT=`date -d "${END_TIME}CET -5minutes" +"%H:%M:%S"`
+# => Fixed for summer time but will probably still fail on the day of the swap itself... so twice a year
+CTEST_END_TIME_LIMIT=`date -d "${END_TIME}${CET_CEST} -5minutes" +"%H:%M:%S"`
 echo "Setting the job time limit for ctest to ${CTEST_END_TIME_LIMIT} to make sure CDASH data is uploaded"
 
 if [[ $# -eq 1 ]]; then
-- 
GitLab