Description of problem:
Attempt to cancel _task_ produces traceback:
$ bkr job-cancel T:23169487
XML-RPC fault: <type 'exceptions.AttributeError'>:'RecipeTask' object has no attribute 'record_activity'
This seems to be regression in comparison to older version where same command worked fine.
This is likely related to bug 995012, which added an audit trail for job activity. In particular: http://gerrit.beaker-project.org/#/c/3059/12/Server/bkr/server/task_actions.py
There's a pylint check that should have caught this prior to release, but we currently have it disabled due to a limitation of the way we're currently declaring our SQL Alchemy models. We were already looking into how to fix that, but I've now captured it explicitly as bug 1124804.
Hmm I didn't even think it was possible to cancel individual tasks. Obviously our test suite doesn't cover it. And a few years ago we removed the ability to cancel recipes because it has some problematic implications (what happens to other recipes in the recipe set? they presumably will not run properly).
Marian, what is the purpose of cancelling an individual task? What's the expected behaviour of the harness in that case? I'm guessing right now the task might be skipped if it's cancelled before the recipe starts, otherwise I imagine beah will just run it normally (but probably fail to report the results for it).
(In reply to Dan Callaghan from comment #3)
> Marian, what is the purpose of cancelling an individual task? What's the
> expected behaviour of the harness in that case? I'm guessing right now the
> task might be skipped if it's cancelled before the recipe starts, otherwise
> I imagine beah will just run it normally (but probably fail to report the
> results for it).
1) From time to time it is useful to cancel running test for several reasons (while this is quite clear surprisingly it is more frequent then I would expect)
2) It seems to be pretty good practice to group tests into one job/recipe to save resources and this really happens.
This is it!
Need of canceling tests and need of saving resources causes a requirement to cancel beaker tasks.
For the harness at this moment it is sufficient to skip canceled task and it does not matter what happens when running task is canceled (it could be handy to stop its execution, however it is another story and another bug; this report is for the regression stated in initial description).
(In reply to Marian Ganisin from comment #4)
> 1) From time to time it is useful to cancel running test
I should state *scheduled* test. Scheduled/running/(whatever state before it is completed) is just "running" from my point of view.
It should be clear also from my description of behavior of harness (I do care about skipping scheduled tasks, and I do not care to much about canceling already running tasks)
> for several reasons
> (while this is quite clear surprisingly it is more frequent then I would
Other than fixing the regression, we also need to record the task cancellations activities. https://bugzilla.redhat.com/show_bug.cgi?id=1127088
Cheers, Matt Jia
Beaker 0.17.3 has been released (https://beaker-project.org/docs/whats-new/release-0.17.html#beaker-0-17-3)