Relax lock timing assertion

This commit is contained in:
thePR0M3TH3AN
2025-06-29 18:42:51 -04:00
parent 22a496b856
commit c0ddedce54
2 changed files with 5 additions and 1 deletions

View File

@@ -2,6 +2,8 @@ import multiprocessing as mp
import time
from pathlib import Path
import pytest
from utils.file_lock import exclusive_lock
@@ -34,4 +36,5 @@ def test_exclusive_lock_blocks_until_released(tmp_path: Path):
p1.join()
p2.join()
assert wait_time.value >= 0.9
# CI runners can be jittery; allow some slack around the 1s lock hold time
assert wait_time.value == pytest.approx(1.0, rel=0.2)

View File

@@ -1,4 +1,5 @@
"""File-based locking utilities using portalocker for cross-platform support."""
from contextlib import contextmanager
from typing import Generator, Optional
from pathlib import Path