Conversation
…r alone Port the CancelEndedJobTests from lightningpixel#341 onto the _job_generators binding introduced in 10cdc15. Ended jobs/runs are driven through _run_generation so the test covers the binding being released, then cancelled via /generate/cancel and /workflow-runs/{id}/cancel; running jobs/runs bound in _job_generators must still have their worker stopped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #341, as suggested there. The fix is already on
dev(10cdc15); this PR only adds tests, with no production code changes.Adds
CancelEndedJobTeststoapi/tests/test_workflow_runs_lifecycle.py, using a fake worker with a live_proc:test_cancelling_a_finished_job_leaves_the_active_worker_alone: runs a job todonethrough_run_generation, checks that its_job_generatorsbinding was released, thencancel_jobleaves the worker running and loaded.test_cancelling_a_failed_run_leaves_the_active_worker_alone: same, for a run that ends inerror, cancelled throughcancel_run.test_cancelling_an_ended_job_leaves_another_jobs_worker_alone: cancelling an ended job does not kill a worker that is now bound to a different running job.test_cancelling_a_running_job_still_stops_the_worker/test_cancelling_a_running_run_still_stops_the_worker: a running job/run bound in_job_generatorsstill has its worker killed.Verification (
python -m unittest discover -s testsinapi/, Python 3.13):dev(221e44e): Ran 222 tests, OK (skipped=2)cancel_jobreverted to look up the active generator (the pre-10cdc15 behaviour): the 3 ended-job tests fail (worker killed). The existing cross-route test also fails. The running-job tests still pass.finally: _job_generators.pop(job_id, None)removed: the 3 ended-job tests fail (binding still present after the job ends).