From 9fa939ff20bab9ee371fde510640968c8acc75e1 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Tue, 27 May 2025 00:39:01 +0200 Subject: [PATCH] Return `Job.jobid` as string always --- reframe/core/schedulers/__init__.py | 2 +- reframe/core/schedulers/local.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reframe/core/schedulers/__init__.py b/reframe/core/schedulers/__init__.py index 18cab9606..0a370159d 100644 --- a/reframe/core/schedulers/__init__.py +++ b/reframe/core/schedulers/__init__.py @@ -480,7 +480,7 @@ def jobid(self): :type: :class:`str` or :class:`None` ''' - return self._jobid + return str(self._jobid) if self._jobid is not None else None @property def exitcode(self): diff --git a/reframe/core/schedulers/local.py b/reframe/core/schedulers/local.py index 87eead753..ec228d867 100644 --- a/reframe/core/schedulers/local.py +++ b/reframe/core/schedulers/local.py @@ -94,7 +94,7 @@ def filternodes(self, job, nodes): def _kill_all(self, job): '''Send SIGKILL to all the processes of the spawned job.''' try: - os.killpg(job.jobid, signal.SIGKILL) + os.killpg(job._jobid, signal.SIGKILL) job._signal = signal.SIGKILL except (ProcessLookupError, PermissionError): # The process group may already be dead or assigned to a different @@ -109,7 +109,7 @@ def _kill_all(self, job): def _term_all(self, job): '''Send SIGTERM to all the processes of the spawned job.''' try: - os.killpg(job.jobid, signal.SIGTERM) + os.killpg(job._jobid, signal.SIGTERM) job._signal = signal.SIGTERM except (ProcessLookupError, PermissionError): # Job has finished already, close file handles @@ -160,11 +160,11 @@ def poll(self, *jobs): self._poll_job(job) def _poll_job(self, job): - if job is None or job.jobid is None: + if job is None or job._jobid is None: return try: - pid, status = os.waitpid(job.jobid, os.WNOHANG) + pid, status = os.waitpid(job._jobid, os.WNOHANG) except OSError as e: if e.errno == errno.ECHILD: # No unwaited children