Skip to content

Commit

Permalink
Trying to get Check running.
Browse files Browse the repository at this point in the history
  • Loading branch information
d-krupke committed Feb 25, 2024
1 parent be76f5a commit f81190b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/slurminade/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ def check_slurm(partition, constraint):

# create a temporary folder for the slurm check
with tempfile.TemporaryDirectory(dir=".") as tmpdir:
tmpdir = Path(tmpdir).resolve()
assert Path(tmpdir).exists()
# Check 1
tmp_file_path = tmpdir + "/check_1.txt"
_write_to_file.distribute_and_wait(tmp_file_path, "test")
tmp_file_path = tmpdir / "check_1.txt"
_write_to_file.distribute_and_wait(str(tmp_file_path), "test")
if not Path(tmp_file_path).exists():
msg = "Slurminade failed: The file was not written to the temporary directory."
raise Exception(msg)
Expand All @@ -56,8 +58,8 @@ def check_slurm(partition, constraint):
)

# Check 2
tmp_file_path = tmpdir + "/check_2.txt"
_write_to_file.distribute(tmp_file_path, "test")
tmp_file_path = tmpdir / "check_2.txt"
_write_to_file.distribute(str(tmp_file_path), "test")
# wait up to 1 minutes for the file to be written
for _ in range(60):
if Path(tmp_file_path).exists():
Expand Down

0 comments on commit f81190b

Please sign in to comment.