toil.test.src.threadingTest

Attributes

log

Classes

TestThreading

Test Toil threading/synchronization tools.

BaseSafeLockingTest

Base class for testing retry and error-swallowing behavior in safe_lock

TestENOLCKSafeLocking

Tests safe_lock and safe_unlock_and_close behavior when fcntl raises ENOLCK (NFS lockd unavailable).

TestEIOSafeLocking

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:

OSError

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: BaseSafeLockingTest

Tests safe_lock and safe_unlock_and_close behavior when fcntl raises ENOLCK (NFS lockd unavailable).

get_error()

Return the OSError to simulate in tests. Must be implemented by subclasses.

Return type:

OSError

class toil.test.src.threadingTest.TestEIOSafeLocking

Bases: BaseSafeLockingTest

Tests safe_lock and safe_unlock_and_close behavior when fcntl raises EIO (Ceph IO error).

get_error()

Return the OSError to simulate in tests. Must be implemented by subclasses.

Return type:

OSError