feathub icon indicating copy to clipboard operation
feathub copied to clipboard

Add test case to verify SparkJob completed exceptionally

Open yunfengzhou-hub opened this issue 11 months ago • 0 comments

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

yunfengzhou-hub avatar Sep 18 '23 01:09 yunfengzhou-hub