diff options
author | Mikael Falkvidd <mfalkvidd@op5.com> | 2014-07-10 14:25:23 +0200 |
---|---|---|
committer | Mikael Falkvidd <mfalkvidd@op5.com> | 2014-07-10 21:10:48 +0200 |
commit | f54d10fe9ba202415c2001b1ec7c6eb4697c3d10 (patch) | |
tree | 4d158b23339b383c374ab3ad43072e6d9999c8b0 /gl/basename-lgpl.c | |
parent | 43b66c06a921b878ba4de2a246a219cca94dd498 (diff) | |
download | monitoring-plugins-f54d10fe9ba202415c2001b1ec7c6eb4697c3d10.tar.gz |
check_procs: Add delay after forking in test
Forking raises a race condition, where the parent might run the
test before the child has had time to fork. If that happens,
an error similar to this is produced:
Failed test 'Output correct'
at ./t/check_procs.t line 32.
'PROCS OK: 0 processes with args 'sleep 7' | processes=0;;;0;'
doesn't match '/^PROCS OK: 1 process?/'
Sleeping a bit should avoid the problem. It might be enough to
sleep less than a second, but perl's built-in sleep function only
supports integer seconds.
In our build environment, the build failed 3 of 4 times before
this patch. After the patch it failed 0 of 7 times.
Signed-off-by: Mikael Falkvidd <mfalkvidd@op5.com>
Diffstat (limited to 'gl/basename-lgpl.c')
0 files changed, 0 insertions, 0 deletions