glance/glance/tests
Dan Smith 8e8072c16a Make wait_for_fork() more robust against infinite deadlock
There is something about the process handling in the functional test base
that opens the scenario where we might signal our API master child,
waitpid() on it and never return (see bug 1891190). Specifically the
test_reload() case, where the API master is being sent SIGHUP various times,
which may cause it to temporarily mask out SIGTERM or something, which
means it ignores our request. Either way, a deadlock in the tests can
occur when the cleanup() routine goes to waitpid() on that master,
forever.

This change makes our wait_for_fork() helper call waitpid() with WNOHANG
and progressively ramp up the aggression on asking it to stop. First, it
waits for the original signal to be honored, then it starts sending SIGTERM,
followed by SIGKILLs until the overall timeout expires, after which it
fails the test. The latter should only ever happen if something gets
wedged in uninterruptible sleep.

Related-Bug: #1891190
Change-Id: Ie0e91e2ee86f33bcdb63eed74f2d9948108acfd4
2020-08-12 06:55:06 -07:00
..
etc Remove unused "copy_from" policy rule 2020-07-15 13:01:58 -07:00
functional Make wait_for_fork() more robust against infinite deadlock 2020-08-12 06:55:06 -07:00
gate Separate out configuration tests 2019-03-22 13:01:14 -04:00
integration Cleanup remove api v1 and registry code 2020-07-14 10:38:19 +00:00
unit Merge "Inspect upload/import stream and set virtual_size" 2020-08-08 05:56:02 +00:00
var Support importing OVA/OVF package to Glance 2016-02-24 14:35:19 -08:00
__init__.py Make glance-api able to do async tasks in WSGI mode 2020-07-24 11:13:45 -07:00
stubs.py Cleanup remove api v1 and registry code 2020-07-14 10:38:19 +00:00
test_hacking.py Hacking checks for not using dict iteration calls 2016-01-25 21:54:08 -08:00
utils.py Make wait_for_fork() more robust against infinite deadlock 2020-08-12 06:55:06 -07:00