Re: [RFC PATCH 3/3] test-lib: add the '--stress' option to run a test repeatedly under load
- From
Jeff King <peff@peff.net>
- Date
- Dec 6, 2018, 05:35 UTC
- Message-ID
- <20181206053525.GA29481@sigill.intra.peff.net>
- In-Reply-To
- <xmqqefavbj28.fsf@gitster-ct.c.googlers.com>
On Thu, Dec 06, 2018 at 09:22:23AM +0900, Junio C Hamano wrote:
Show 8 quoted lines
> > So the right number of waits is either "1" or "2". Looping means we do > > too many (which is mostly a harmless noop) or too few (in the off chance > > that you have only a single job ;) ). So it works out in practice. > > Well, if you time your ^C perfectly, no number of waits is right, I > am afraid. You spawn N processes and while looping N times waiting > for them, you can ^C out of wait before these N processes all die, > no?
Each "wait" will try to collect all processes, but may be interrupted by a signal. So the correct number is actually "1 plus the number of times the user hits ^C". I had assumed the user was just hitting it once, though putting the wait into the trap means we do that "1 plus" thing anyway.
I could also see an argument that subsequent ^C's should exit immediately, but I think we are getting well into the realm of over-engineering.
-Peff