def __init__(self, job_id, execution, *, no_overlap: bool = False, **params): self._id = JobInstanceID(job_id, util.unique_timestamp_hex()) self._params = params self._execution = execution self._no_overlap = no_overlap self._lifecycle: ExecutionLifecycleManagement = ExecutionLifecycleManagement( ) self._last_output = deque(maxlen=10) self._exec_error = None self._executing = False self._stopped_or_interrupted: bool = False self._executing_flag_lock: Lock = Lock() self._state_lock: RLock = RLock() self._latch: Optional[Event] = None self._latch_wait_state: Optional[ExecutionState] = None self._warnings = Counter() self._state_observers = [] self._warning_observers = [] self._output_observers = [] self._state_change(ExecutionState.CREATED)
def test_successful(observer: TestStateObserver): dir_name = util.unique_timestamp_hex() run_app('exec -mc mkdir ' + dir_name) assert observer.exec_state(-1) == ExecutionState.COMPLETED os.rmdir(dir_name) # Exc if not existed
def _listener_socket_name(ext): return util.unique_timestamp_hex() + ext