toil.test.src.checkpointTest

Module Contents

Classes

CheckpointTest

A common base class for Toil tests.

CheckRetryCount

Fail N times, succeed on the next try.

AlwaysFail

Class represents a unit of work in toil.

CheckpointFailsFirstTime

Class represents a unit of work in toil.

FailOnce

Fail the first time the workflow is run, but succeed thereafter.

class toil.test.src.checkpointTest.CheckpointTest(methodName='runTest')[source]

Bases: toil.test.ToilTest

digraph inheritancea13895762a { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "CheckpointTest" [URL="#toil.test.src.checkpointTest.CheckpointTest",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ToilTest" -> "CheckpointTest" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TestCase" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="A class whose instances are single test cases."]; "ToilTest" [URL="../../index.html#toil.test.ToilTest",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A common base class for Toil tests."]; "TestCase" -> "ToilTest" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

A common base class for Toil tests.

Please have every test case directly or indirectly inherit this one.

When running tests you may optionally set the TOIL_TEST_TEMP environment variable to the path of a directory where you want temporary test files be placed. The directory will be created if it doesn’t exist. The path may be relative in which case it will be assumed to be relative to the project root. If TOIL_TEST_TEMP is not defined, temporary files and directories will be created in the system’s default location for such files and any temporary files or directories left over from tests will be removed automatically removed during tear down. Otherwise, left-over files will not be removed.

testCheckpointNotRetried()[source]

A checkpoint job should not be retried if the workflow has a retryCount of 0.

testCheckpointRetriedOnce()[source]

A checkpoint job should be retried exactly once if the workflow has a retryCount of 1.

testCheckpointedRestartSucceeds()[source]

A checkpointed job should succeed on restart of a failed run if its child job succeeds.

class toil.test.src.checkpointTest.CheckRetryCount(numFailuresBeforeSuccess)[source]

Bases: toil.job.Job

digraph inheritance7e41974ffb { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "CheckRetryCount" [URL="#toil.test.src.checkpointTest.CheckRetryCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Fail N times, succeed on the next try."]; "Job" -> "CheckRetryCount" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Job" [URL="../../../job/index.html#toil.job.Job",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Class represents a unit of work in toil."]; }

Fail N times, succeed on the next try.

getNumRetries(fileStore)[source]

Mark a retry in the fileStore, and return the number of retries so far.

run(fileStore)[source]

Override this function to perform work and dynamically create successor jobs.

Parameters

fileStore – Used to create local and globally sharable temporary files and to send log messages to the leader process.

Returns

The return value of the function can be passed to other jobs by means of toil.job.Job.rv().

class toil.test.src.checkpointTest.AlwaysFail(memory=None, cores=None, disk=None, accelerators=None, preemptible=None, preemptable=None, unitName='', checkpoint=False, displayName='', descriptionClass=None, local=None)[source]

Bases: toil.job.Job

digraph inheritance409202e968 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "AlwaysFail" [URL="#toil.test.src.checkpointTest.AlwaysFail",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Job" -> "AlwaysFail" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Job" [URL="../../../job/index.html#toil.job.Job",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Class represents a unit of work in toil."]; }

Class represents a unit of work in toil.

Parameters
  • memory (Optional[ParseableIndivisibleResource]) –

  • cores (Optional[ParseableDivisibleResource]) –

  • disk (Optional[ParseableIndivisibleResource]) –

  • accelerators (Optional[ParseableAcceleratorRequirement]) –

  • preemptible (Optional[ParseableFlag]) –

  • preemptable (Optional[ParseableFlag]) –

  • unitName (Optional[str]) –

  • checkpoint (Optional[bool]) –

  • displayName (Optional[str]) –

  • descriptionClass (Optional[type]) –

  • local (Optional[bool]) –

run(fileStore)[source]

Override this function to perform work and dynamically create successor jobs.

Parameters

fileStore – Used to create local and globally sharable temporary files and to send log messages to the leader process.

Returns

The return value of the function can be passed to other jobs by means of toil.job.Job.rv().

class toil.test.src.checkpointTest.CheckpointFailsFirstTime[source]

Bases: toil.job.Job

digraph inheritancea08f012890 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "CheckpointFailsFirstTime" [URL="#toil.test.src.checkpointTest.CheckpointFailsFirstTime",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Job" -> "CheckpointFailsFirstTime" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Job" [URL="../../../job/index.html#toil.job.Job",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Class represents a unit of work in toil."]; }

Class represents a unit of work in toil.

run(fileStore)[source]

Override this function to perform work and dynamically create successor jobs.

Parameters

fileStore – Used to create local and globally sharable temporary files and to send log messages to the leader process.

Returns

The return value of the function can be passed to other jobs by means of toil.job.Job.rv().

class toil.test.src.checkpointTest.FailOnce(memory=None, cores=None, disk=None, accelerators=None, preemptible=None, preemptable=None, unitName='', checkpoint=False, displayName='', descriptionClass=None, local=None)[source]

Bases: toil.job.Job

digraph inheritance0a3cf31def { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "FailOnce" [URL="#toil.test.src.checkpointTest.FailOnce",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Fail the first time the workflow is run, but succeed thereafter."]; "Job" -> "FailOnce" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Job" [URL="../../../job/index.html#toil.job.Job",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Class represents a unit of work in toil."]; }

Fail the first time the workflow is run, but succeed thereafter.

Parameters
  • memory (Optional[ParseableIndivisibleResource]) –

  • cores (Optional[ParseableDivisibleResource]) –

  • disk (Optional[ParseableIndivisibleResource]) –

  • accelerators (Optional[ParseableAcceleratorRequirement]) –

  • preemptible (Optional[ParseableFlag]) –

  • preemptable (Optional[ParseableFlag]) –

  • unitName (Optional[str]) –

  • checkpoint (Optional[bool]) –

  • displayName (Optional[str]) –

  • descriptionClass (Optional[type]) –

  • local (Optional[bool]) –

run(fileStore)[source]

Override this function to perform work and dynamically create successor jobs.

Parameters

fileStore – Used to create local and globally sharable temporary files and to send log messages to the leader process.

Returns

The return value of the function can be passed to other jobs by means of toil.job.Job.rv().