diff options
| author | Scott <[email protected]> | 2022-02-02 13:47:36 -0800 |
|---|---|---|
| committer | Scott <[email protected]> | 2022-02-02 13:47:36 -0800 |
| commit | 7ff2af6fe7bffea90dc4a31c93140c189917c659 (patch) | |
| tree | 34cb138c3a572037b5bc1d1b52ad9d25a2604ccb /executors.py | |
| parent | 6ba90a1f30f1c0cf4df12fcd0c62181f29bc3668 (diff) | |
Let's be explicit with asserts; there was a bug in histogram
caused by assert foo when foo was an int with valid valid 0.
Diffstat (limited to 'executors.py')
| -rw-r--r-- | executors.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/executors.py b/executors.py index 34528a3..b4cb06b 100644 --- a/executors.py +++ b/executors.py @@ -345,7 +345,7 @@ class RemoteExecutorStatus: self.in_flight_bundles_by_worker[worker].remove(uuid) if not was_cancelled: start = self.start_per_bundle[uuid] - assert start + assert start is not None bundle_latency = ts - start x = self.finished_bundle_timings_per_worker.get(worker, list()) x.append(bundle_latency) @@ -740,7 +740,7 @@ class RemoteExecutor(BaseExecutor): worker = None while worker is None: worker = self.find_available_worker_or_block(avoid_machine) - assert worker + assert worker is not None # Ok, found a worker. bundle.worker = worker @@ -840,7 +840,7 @@ class RemoteExecutor(BaseExecutor): self, p: Optional[subprocess.Popen], bundle: BundleDetails, depth: int ) -> Any: machine = bundle.machine - assert p + assert p is not None pid = p.pid if depth > 3: logger.error( @@ -984,7 +984,7 @@ class RemoteExecutor(BaseExecutor): # Tell the original to stop if we finished first. if not was_cancelled: orig_bundle = bundle.src_bundle - assert orig_bundle + assert orig_bundle is not None logger.debug( f'{bundle}: Notifying original {orig_bundle.uuid} we beat them to it.' ) |
