toil.test.src.threadingTest¶
Attributes¶
Classes¶
Test Toil threading/synchronization tools. |
|
Base class for testing retry and error-swallowing behavior in safe_lock |
|
Tests safe_lock and safe_unlock_and_close behavior when fcntl raises ENOLCK (NFS lockd unavailable). |
|
Tests safe_lock and safe_unlock_and_close behavior when fcntl raises EIO (Ceph IO error). |
Module Contents¶
- toil.test.src.threadingTest.log¶
- class toil.test.src.threadingTest.TestThreading¶
Test Toil threading/synchronization tools.
- testGlobalMutexOrdering(tmp_path)¶
- Parameters:
tmp_path (pathlib.Path)
- Return type:
None
- testLastProcessStanding(tmp_path)¶
- Parameters:
tmp_path (pathlib.Path)
- Return type:
None
- class toil.test.src.threadingTest.BaseSafeLockingTest¶
Base class for testing retry and error-swallowing behavior in safe_lock and safe_unlock_and_close. Subclasses provide the specific OSError to test by implementing get_error().
- abstractmethod get_error()¶
Return the OSError to simulate in tests. Must be implemented by subclasses.
- Return type:
- test_safe_lock_retries()¶
safe_lock should retry on a transient error and succeed on the second attempt.
- Return type:
None
- test_safe_lock_fails_after_max_retries()¶
safe_lock should raise OSError after exhausting all retries.
- Return type:
None
- test_safe_unlock_and_close_swallows()¶
safe_unlock_and_close should swallow the error and still close the fd.
- Return type:
None
- class toil.test.src.threadingTest.TestENOLCKSafeLocking¶
Bases:
BaseSafeLockingTestTests safe_lock and safe_unlock_and_close behavior when fcntl raises ENOLCK (NFS lockd unavailable).
- class toil.test.src.threadingTest.TestEIOSafeLocking¶
Bases:
BaseSafeLockingTestTests safe_lock and safe_unlock_and_close behavior when fcntl raises EIO (Ceph IO error).