From 47ac7bfbc4c5b6a3db812a59542e6c91d5dd58ed Mon Sep 17 00:00:00 2001 From: Marcel Loose Date: Thu, 14 Nov 2024 16:04:36 +0100 Subject: [PATCH] Fix CWL Workflow Slurm memory test (#5151) * Fix Slurm memory test * fix unrelated typing error due to new version of psutil --------- Co-authored-by: Michael R. Crusoe Co-authored-by: Adam Novak --- src/toil/test/cwl/cwlTest.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/toil/test/cwl/cwlTest.py b/src/toil/test/cwl/cwlTest.py index 8f471570b7..5b8a13733e 100644 --- a/src/toil/test/cwl/cwlTest.py +++ b/src/toil/test/cwl/cwlTest.py @@ -526,7 +526,12 @@ def test_slurm_node_memory(self) -> None: log.debug("Workflow output: %s", out) memory_string = out["memory"] log.debug("Observed memory: %s", memory_string) - result = int(memory_string) + # If there's no memory limit enforced, Slurm will return "unlimited". + # Set result to something sensible. + if memory_string.strip() == "unlimited": + result = 4 * 1024 * 1024 + else: + result = int(memory_string) # We should see more than the CWL default or the Toil default, assuming Slurm nodes of reasonable size (3 GiB). self.assertGreater(result, 3 * 1024 * 1024)