]> git.ipfire.org Git - thirdparty/libvirt.git/commit
tests: commandtest: Make 'test4' checking daemonization more reliable
authorPeter Krempa <pkrempa@redhat.com>
Tue, 21 Jul 2020 10:32:10 +0000 (12:32 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 27 Jul 2020 13:44:38 +0000 (15:44 +0200)
commit6ae53a1509748290007c6e1df99a97e66ec16497
tree1ddfe530a0ec673cd052d3e285a7df55d17f6db6
parent957107184fb09cab28c48de8dc6fbfdf51d55725
tests: commandtest: Make 'test4' checking daemonization more reliable

The 'commandhelper' checks effectively whether the parent process is
still around to report whether it was daemonized or not.

This creates a unlikely race condition in cases when we do actually
daemonize the process as the intermediate process used for the
daemonization might not have terminated yet which would report wrong
result leading to test failure.

For now there's just 'test4' which actually daemonizes the process.

Add an argument '--check-daemonize' which asks for retries of the
daemonization check in cases where we expect that the commandhelper is
going to be daemonized and use it in 'test4' to make the test more
reliable.

I've observed the test failure sporadically when my box is under load
e.g. while building two trees at once.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/commanddata/test4.log
tests/commandhelper.c
tests/commandtest.c