check_procs: Add delay after forking in test (#1272)

Mikael Falkvidd notifications at
Thu Jul 10 21:17:14 CEST 2014

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 at>
You can merge this Pull Request by running:

  git pull master

Or you can view, comment on it, or merge it online at:

-- Commit Summary --

  * check_procs: Add delay after forking in test

-- File Changes --

    M plugins/t/check_procs.t (2)

-- Patch Links --

Reply to this email on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Devel mailing list