From 6ef9dc28db3ce6bcaba15c98bdb0f802b59d4b37 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Tue, 29 Oct 2024 11:05:38 +0100 Subject: [PATCH] Cache: Use absolute path for working directory --- executorlib/standalone/cache/queue.py | 3 ++- tests/test_cache_executor_pysqa_flux.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/executorlib/standalone/cache/queue.py b/executorlib/standalone/cache/queue.py index 40570eea..9975df0d 100644 --- a/executorlib/standalone/cache/queue.py +++ b/executorlib/standalone/cache/queue.py @@ -1,3 +1,4 @@ +import os from typing import List, Optional from pysqa import QueueAdapter @@ -32,7 +33,7 @@ def execute_with_pysqa( submit_kwargs = { "command": " ".join(command), "dependency_list": [str(qid) for qid in task_dependent_lst], - "working_directory": resource_dict["cwd"], + "working_directory": os.path.abspath(resource_dict["cwd"]), } del resource_dict["cwd"] unsupported_keys = [ diff --git a/tests/test_cache_executor_pysqa_flux.py b/tests/test_cache_executor_pysqa_flux.py index bceaafe6..7888a288 100644 --- a/tests/test_cache_executor_pysqa_flux.py +++ b/tests/test_cache_executor_pysqa_flux.py @@ -34,7 +34,7 @@ class TestCacheExecutorPysqa(unittest.TestCase): def test_executor(self): with Executor( backend="pysqa_flux", - resource_dict={"cores": 2, "cwd": os.path.abspath("cwd")}, + resource_dict={"cores": 2, "cwd": "exe_working_directory"}, block_allocation=False, ) as exe: cloudpickle_register(ind=1)