I posted this to the Boost testing list but it contains a patch to Boost build bjam source code (execunix.c) so I thought I'd better post it here as well.  The patch implements the -lx bjam option to terminate actions that exceed x seconds of either elapsed or wall clock time.

Begin forwarded message:

From: "K. Noel Belcourt" <kbelco@sandia.gov>
Date: September 15, 2007 12:56:42 PM MDT
To: "Running Boost regression tests" <boost-testing@lists.boost.org>
Subject: Re: [Boost-testing] [interprocess] upgradeable_mutex_test deadlocking on sun-5.8

On Sep 15, 2007, at 11:52 AM, Rene Rivera wrote:

K. Noel Belcourt wrote:
On Sep 14, 2007, at 9:37 AM, K. Noel Belcourt wrote:
On Sep 14, 2007, at 9:30 AM, Rene Rivera wrote:

This sounds like fun.  I'll take a look.

I've got this in and working.


The attached patch has been compiled with Sun, Ibm (vacpp), Gcc, Intel, Pathscale, and Pgi unix toolsets.  As you'll notice in the patch, I use both setrlimit, to set a maximum cpu process usage limit, and have logic to compute the elapsed time in seconds to catch processes that hang and fail to consume any cpu.  The setrlimit call is not strictly necessary and could be removed, but I've left it in for now, and it may be useful to constrain other resource usage in the future).

I've set up all my nightly Boost regression tests to pass -l100, just to make sure something gets killed and reaped.  This means the Sandia results will be suspect for the next day or so as I may be killing tests that would, if given enough time, complete and pass just fine.  If my tests run okay tonight (no hangs or other weirdness), and there's no other objections, I'll commit this patch to the trunk sometime tomorrow.

-- Noel