[Avocado-devel] no sigterm_handler stack trace on test timeout?

Brian J. Murrell brian at interlinx.bc.ca
Tue Nov 13 18:54:14 UTC 2018


On Tue, 2018-11-13 at 12:49 -0500, Cleber Rosa wrote:
> 
> AFAICT, every test gets this handler installed.

...

> I don't see a code path in which test processes don't have the
> sigterm
> handler installed, but there are different code paths regarding the
> ending of the test process.  On the first example I can see:
> 
> "ERROR Test reported status but did not finish"

Right.  After the SIGTERM handler was invoked which it should be
because the test timed out.

> 
> While on the second I can see:
> 
> "ERROR Test died without reporting the status"

Which means what exactly?  That the python test died out from under
avocado by some means other than exiting due to an exception?

These two messages don't seem to square:

2018-11-13 01:18:15,555 runner           L0253 ERROR| ERROR Test died
without reporting the status. -> TestAbortedError: 3-
/var/lib/jenkins/workspace/daos-stack-org_daos_PR-13-
centos7/src/tests/ftest/pool/PoolSvc.py:PoolSvc.test_poolsvc;mode_RW-
createset-createsize-svc3-test_machine1-server-aa67.
2018-11-13
01:18:15,555 runner           L0255 WARNI| Killing hanged test process
29558

Since the first one is saying the test died but then the second one
says it's hanged and killing it.  Died and hanged are very different
and reporting both is confusing at best.

> On this second example, the process is supposed to have died already,
> so
> it makes no sense to send it a SIGTERM.

So why did the timeout expire and it report:

2018-11-13 01:18:16,663 runner           L0061 ERROR| Runner error occurred: Timeout reached

> With regards to tearDown(), it's not something that gets run on test
> the
>  process signal handler (as a cleanup stage), but it's part of the
> general test execution flow.

I'm afraid I'm not parsing the above.

> Avocado attempts to make sure tearDown()
> is executed in spite of error conditions on the test() methods, but
> not
> to the point of intercepting SIGTERM and running tearDown() code at
> that
> time.

So tearDown() is not suppose to run if a test times out?  I think my
first example from the previous post proves that's not true and that
when a test times out tearDown() is run.

> Is this what you're trying to achieve here?

I am trying to make sure that no matter what the test does, if setUp()
even got started (and perhaps it times out before completing)
tearDown() is run (which needs 
https://github.com/avocado-framework/avocado/issues/2908 to ensure it
has time to run it in the event of a timeout).

TL;DR, every setUp() (even if it times out) requires a tearDown() no
matter what happens in between.

Cheers,
b.





More information about the Avocado-devel mailing list