Closed (fixed)
Project:
Project issue file test
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
2 Jul 2015 at 06:12 UTC
Updated:
28 Sep 2015 at 22:24 UTC
Jump to comment: Most recent
As part of the DrupalCI MVP deployment core maintainers would like the ability to cancel a pending or in-progress test - to save time in instances of known bad patches, hung testbot states, etc..
A further delineation of use cases for canceling tests would likely be useful.
Permissions:
2 ways to cancel jobs in Jenkins:
ci_url set, as in the test has started, the request to cancel is a straightforward HTTP request.
Comments
Comment #1
hestenetThe short term solution for this is simply granting Jenkins access to trusted core devs to cancel jobs.
A blocker right now is that a canceled job in Jenkins does not kill the container.
We discussed solutions during the weekly testbot meeting.
The testbot host itself will likely need to check to see if it's still supposed to be running and kill if not.
Comment #2
tim.plunkettI think "known bad patches" covers most of my usages of this. Or, "I uploaded 3 patches in quick succession, please cancel the first two", which is a subset of that.
I get pings like that about 2 times a week, more during sprints or when qa.d.o used to get backed up.
Comment #3
MixologicComment #4
yesct commentedI dont think this is a blocker to disabling the old testbots. (but is an important feature to add to the new ones.)
Comment #5
basic commentedOur idea for solving this is to use a "drupalci clean" command before each test run to ensure the test runner is in a clean state.
If a test is cancelled, the test runner may still be running on the spot instance, but the next job that is assigned to the test runner would:
drupalci clean
drupalci run
Which would always start the next test in a clean state.
Comment #6
isntall commentedThis should also have the added benefit of Jenkins killing the testrunner once it reaches the timeout, end or the billable hour.
Comment #7
isntall commentedThe dispatcher.dci.o work has been completed for this. It should no longer be a blocker for the front-end/drupal.org side.
A little bit of how I see this working
Cancel button is pressed on d.o
Once a 'Cancel' request has been received dispatcher.dci.o, Jenkins will stop the job and change the state of the testrunner to idle.
In the idle state a new job can be sent to a testrunner, or it can be terminated.
Comment #8
drummWho should have access to do this? Should everyone have access to cancel their own tests?
Is a POST to
https://dispatcher.drupalci.org/job/{job}/{build}/stop?token=correct_tokenthe correct way to stop it?Comment #9
drummComment #10
basic commentedIt looks like that GET request is correct for builds that have started. If the build hasn't started and it is still in a queued state then there should be a post to https://dispatcher.drupalci.org/queue/cancelItem?id=
http://stackoverflow.com/questions/21021905/how-to-stop-a-build-in-jenki...
Comment #11
hestenetDiscussing this internally and based on the comments in the issue above:
1) We'll go ahead and great the ability of anyone who submitted a patch the ability to cancel their own tests.
2) We'll likely also allow project maintainers to cancel tests in their projects.
Comment #12
hestenetComment #13
drummThis will be done in 3 parts:
PIFT_CI_STATUS_QUEUE, the test hasn't been sent yet, and can be aborted without sending to the dispatcher.ci_urlset, as in the test has started, the request to cancel is a straightforward HTTP request.Comment #14
drummComment #15
wim leers#11 sounds awesome.
Comment #16
drummI'll leave this part off. Jobs are in this state for less than a minute, which we might minimize in the future with supervisord & beanstalk.
Comment #19
drummCanceling running tests is now working.
Comment #20
drummI'm going to call this done. Most of the time, there isn't much of a queueing step in Jenkins. A followup can be filed if it is needed.