mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-09 07:48:57 +00:00
Relax lock timing assertion
This commit is contained in:
@@ -2,6 +2,8 @@ import multiprocessing as mp
|
|||||||
import time
|
import time
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from utils.file_lock import exclusive_lock
|
from utils.file_lock import exclusive_lock
|
||||||
|
|
||||||
|
|
||||||
@@ -34,4 +36,5 @@ def test_exclusive_lock_blocks_until_released(tmp_path: Path):
|
|||||||
p1.join()
|
p1.join()
|
||||||
p2.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)
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
"""File-based locking utilities using portalocker for cross-platform support."""
|
"""File-based locking utilities using portalocker for cross-platform support."""
|
||||||
|
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from typing import Generator, Optional
|
from typing import Generator, Optional
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
Reference in New Issue
Block a user