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:
- 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:
expected_events (
Mapping
[JobID
,Iterable
[SetAttribute
]]) –unexpected_events (
Optional
[Mapping
[JobID
,Iterable
[SetAttribute
]]]) –timeout (
int
) –
- Returns:
all_good –
True
is all events occurred and no unexpected events occurred.False
if it timed out, or if any unexpected events occurred.- Return type:
- 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:
job_ids – The job ids to wait for. You may find
ClusterHandle.job_ids
useful.timeout –
- Returns:
all_good –
True
is all events occurred and no unexpected events occurred.False
if it timed out, or if any unexpected events occurred.- Return type:
- class ornithology.SetJobStatus(new_status)[source]
A subclass of
SetAttribute
specialized for a job status change.