Skip to content

Commit

Permalink
Linters & Create Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matveyvarg committed Dec 18, 2023
1 parent b9dd392 commit 64acb85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions deker/locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,10 @@ def get_result(self, func: Callable, args: Any, kwargs: Any) -> Any:
return result

def release(self, e: Optional[Exception] = None) -> None:
"""Release Flock.
:param e: exception that might have been raised
"""
self.path.unlink(missing_ok=True)
super().release(e)

Expand Down
5 changes: 4 additions & 1 deletion tests/test_cases/test_concurrency/test_in_processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
UpdateMetaAttributeLock,
WriteArrayLock,
WriteVarrayLock,
CreateArrayLock,
)
from deker.schemas import ArraySchema, DimensionSchema, VArraySchema
from deker.tools import get_paths
Expand Down Expand Up @@ -104,7 +105,9 @@ def call_array_method(
# Get Array object
if method == "create":
with patch.object(
Flock, "release", wait_unlock(Flock.release, lock_set, funcs_finished, wait)
CreateArrayLock,
"release",
wait_unlock(CreateArrayLock.release, lock_set, funcs_finished, wait),
):
with patch("deker.ABC.base_array.get_id", lambda *a: id_):
try:
Expand Down

0 comments on commit 64acb85

Please sign in to comment.