Don't use a fixed iteration count in dist/threads-shared/t/stress.t
authorNicholas Clark <nick@ccl4.org>
Mon, 3 Dec 2012 20:12:33 +0000 (21:12 +0100)
committerNicholas Clark <nick@ccl4.org>
Fri, 11 Jan 2013 10:21:31 +0000 (11:21 +0100)
commit1765a17458779629f77333645777cc05c08e1981
tree703434f6bf095c07afa0afc2fb457fcac8cb1cfa
parent64bb98afbbc7c215df7bc389ce005faffa473132
Don't use a fixed iteration count in dist/threads-shared/t/stress.t

Looping 500,000 times takes between 0.025s and 1s depending on hardware and
optimisation levels on machines I have access to. For a fixed iteration
count, on a particularly slow machine the timeout can fire before all
threads have had a realistic chance to complete, but dropping the iteration
count will cause fast machines to finish each thread too quickly.

So use an initial busy loop (single-thread) to estimate a suitable iteration
count to use for the per-thread test loop.
dist/threads-shared/t/stress.t