feathub
feathub copied to clipboard
Add test case to verify SparkJob completed exceptionally
class SparkJob(ProcessorJob):
"""Represent a Spark job."""
def __init__(
self,
job_future: Future,
) -> None:
super().__init__()
self._job_future = job_future
# TODO: Add test case to verify this method's behavior when job future
# is completed exceptionally.
def cancel(self) -> Future:
cancel_future: Future = Future()
job_future_callback = self._get_job_future_callback(cancel_future)
self._job_future.add_done_callback(job_future_callback)
return cancel_future