From d01d4dfe0c0c3c7ddc78cc635e0d17270d020d5d Mon Sep 17 00:00:00 2001 From: Rupert Swarbrick Date: Thu, 2 Apr 2026 16:43:45 +0100 Subject: [PATCH] Fix type of JobSpec.timeout_mins This is set from Deploy.get_timeout_mins, which returns a float (probably the right type for this: "time out after 2.5 minutes" seems like a reasonable thing to say). Signed-off-by: Rupert Swarbrick --- src/dvsim/job/data.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dvsim/job/data.py b/src/dvsim/job/data.py index d820738c..7537fe59 100644 --- a/src/dvsim/job/data.py +++ b/src/dvsim/job/data.py @@ -9,6 +9,7 @@ capture the results of the job run. """ +import math from collections.abc import Callable, Mapping, Sequence from pathlib import Path @@ -80,7 +81,7 @@ class JobSpec(BaseModel): """Wait for dependent jobs to pass before scheduling.""" weight: int """Weight to apply to the scheduling priority.""" - timeout_mins: int | None + timeout_mins: float | None """Timeout to apply to the launched job.""" cmd: str @@ -126,7 +127,7 @@ def id(self) -> str: @property def timeout_secs(self) -> int | None: """Returns the timeout applied to the launched job, in seconds.""" - return None if self.timeout_mins is None else self.timeout_mins * 60 + return None if self.timeout_mins is None else math.floor(self.timeout_mins * 60) class JobStatusInfo(BaseModel):