From a5433ee5e123ceae21434a9e68bcbeabf900093a Mon Sep 17 00:00:00 2001 From: Manuel Stutz Date: Mon, 3 Jul 2023 16:56:32 +0200 Subject: [PATCH 1/2] Fix #2944 by adapting the regular expression to allow both available formats The RegEx now supports `id: XXX` as well as `Job_Id: XXX`. Additionally, the link to the oarstat source is updated. --- reframe/core/schedulers/oar.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reframe/core/schedulers/oar.py b/reframe/core/schedulers/oar.py index 7711e32b28..504398852c 100644 --- a/reframe/core/schedulers/oar.py +++ b/reframe/core/schedulers/oar.py @@ -136,9 +136,11 @@ def poll(self, *jobs): # Typical oarstat -fj output: # https://github.com/oar-team/oar/blob/0fccc4fc3bb86ee935ce58effc5aec514a3e155d/sources/core/qfunctions/oarstat#L310 + # Update 2023-07: oarstat now supports multiple types of output, once containing `id: XXX` and once containing `Job_Id: XXX` + # https://github.com/oar-team/oar/blob/37db5384c7827cca2d334e5248172bb700015434/sources/core/qfunctions/oarstat#L332 job_raw_info = completed.stdout jobid_match = re.search( - r'^Job_Id:\s*(?P\S+)', completed.stdout, re.MULTILINE + r'^(Job_Id|id):\s*(?P\S+)', completed.stdout, re.MULTILINE ) if jobid_match: jobid = jobid_match.group('jobid') From 1fa9aaa22c39add4e8d23330c3ff969ecaaafe85 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Mon, 3 Jul 2023 21:32:15 +0300 Subject: [PATCH 2/2] Style fixes --- reframe/core/schedulers/oar.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reframe/core/schedulers/oar.py b/reframe/core/schedulers/oar.py index 504398852c..5b55d2a9aa 100644 --- a/reframe/core/schedulers/oar.py +++ b/reframe/core/schedulers/oar.py @@ -135,8 +135,12 @@ def poll(self, *jobs): jobinfo = {} # Typical oarstat -fj output: + # # https://github.com/oar-team/oar/blob/0fccc4fc3bb86ee935ce58effc5aec514a3e155d/sources/core/qfunctions/oarstat#L310 - # Update 2023-07: oarstat now supports multiple types of output, once containing `id: XXX` and once containing `Job_Id: XXX` + # + # Update 2023-07: oarstat now supports multiple types of output, + # once containing `id: XXX` and once containing `Job_Id: XXX` + # # https://github.com/oar-team/oar/blob/37db5384c7827cca2d334e5248172bb700015434/sources/core/qfunctions/oarstat#L332 job_raw_info = completed.stdout jobid_match = re.search(