in reply to Timeout on prove

Install Time::Limit and then run:

prove -MTime::Limit=60 -Ilib /path/to/tests

(This works less well if you are using forkprove, but should be fine with the standard prove tool.)

Or in an individual test:

use Time::Limit "30"; # quote marks around the number are required!

Update: actually it works OK with forkprove, if you get Time::Limit to send its kill signal to the process group:

forkprove -MTime::Limit=-group,60 -Ilib /path/to/tests

Replies are listed 'Best First'.
Re^2: Timeout on prove
by chrestomanci (Priest) on Jul 03, 2014 at 10:56 UTC

    Thanks, that is just what I need.

    I will add an overall time-out of half an hour or so to the overall prove run, and then encourage other developers to add a more conservative time-out to each unit test, so that it times out more quickly if there is a bug.