[Avocado-devel] Subprocess termination

Lucas Meneghel Rodrigues lookkas at gmail.com
Mon Feb 20 14:12:56 UTC 2017


As an example, I wrote scylla-cluster-tests

https://github.com/scylladb/scylla-cluster-tests/

This test suite creates instances and storages on cloud providers, such as
AWS. Those resources cost money, so making sure stray instances are
properly terminated is paramount. There are cleanup procedures defined for
normal test workflow (PASS/FAIL) and also emergency cleanups.

For test development, it's normal that bugs happen as authors write new
tests and features, so some times the normal cleanup procedures don't get a
chance to run. I've used the avocado runner queue to put cleanup procedures
right after the resources are created, so that (at least a part of) bugs
introduced during development will not prevent the test from cleaning up
the generated resources.

You can argue that instances on cloud providers, database connections and
such are more complex and borderline impossible to be automagically
accounted for by the framework. But still, I believe processes are in the
scope of what test writers should account and clean up themselves in
setup/teardown methods.

On Mon, Feb 20, 2017 at 3:04 PM Cleber Rosa <crosa at redhat.com> wrote:


On 02/20/2017 07:13 AM, Andrei Stepanov wrote:
> Hi
>
> Cleber, I think your example is not completely correct. You use "jobs".
> Bash/csh/zsh jobs is another topic.  Your example is about bash jobs.
> Let's take a look a level up:
>
> 1. open xterm/gnome-terminal.
> 2. Run + put it in background: sleep 600 &
> 3. Close the terminal.
> 4. Check for processes. sleep is not disconnected.
>
>

Right, the example was an analogy (not a technical deep dive of the
implementation). It was intended to be didactic, and it looks like that
goal was achieved.

--
Cleber Rosa
[ Sr Software Engineer - Virtualization Team - Red Hat ]
[ Avocado Test Framework - avocado-framework.github.io ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/avocado-devel/attachments/20170220/e1cd3ab7/attachment.htm>


More information about the Avocado-devel mailing list