Job Queue Log Reader

class ornithology.JobQueue(condor)[source]
events()[source]

Yield a flat stream of events from the job queue log (ignoring transaction structure).

filter(condition)[source]

Yield a flat stream of events on the job queue log that satisfy some condition (ignoring transaction structure).

Parameters:

condition

read_transactions()[source]

Yield transactions (i.e., lists) of (jobid, event) pairs from the job queue log.

Return type:

Iterator[List[Tuple[JobID, SetAttribute]]]

wait_for_events(expected_events, unexpected_events=None, timeout=120)[source]

Wait for job queue events to occur.

This method is primarily intended for test setup; see in_order() for a way to assert that job queue events occurred in a certain order post-facto.

All this method cares about is what the next event is for a particular jobid. If events come out of order, it will not record the out-of-order ones!

This method never raises an exception intentionally, even when it times out. It simply returns control to the test, so that the test itself can declare failure. Log messages are recorded with detailed information in either case.

Parameters:
Returns:

all_goodTrue is all events occurred and no unexpected events occurred. False if it timed out, or if any unexpected events occurred.

Return type:

bool

wait_for_job_completion(job_ids, timeout=120)[source]

Wait for a set of job ids to reach the completed state. If any of the jobs reach a non-complete terminal state (held, removed, etc.) this function will immediately return False.

Parameters:
Returns:

all_goodTrue is all events occurred and no unexpected events occurred. False if it timed out, or if any unexpected events occurred.

Return type:

bool

class ornithology.SetAttribute(attribute, value)[source]
class ornithology.SetJobStatus(new_status)[source]

A subclass of SetAttribute specialized for a job status change.