public static void runInstrumentedManyTimes(
	    final MultithreadedTestCase test, int count, int[] failureCount)
	    throws Throwable {
	int failures = 0;
	Throwable t = null;
	boolean failed = false;

	System.out.println("Testing " + test.getClass());

	for (int i = 0; i < count; i++) {
	    try {
		runOnce(test);
	    } catch (Throwable e) {
		failed = true;
		failures++;
		if (t == null)
		    t = e;
	    }
	    if (i % 10 == 9) {
		if (failed) {
		    System.out.print("f");
		    failed = false;
		} else
		    System.out.print(".");
		if (i % 100 == 99)
		    System.out.println(" " + (i + 1));
	    }
	}
	if (failureCount != null && failureCount.length > 0)
	    failureCount[0] = failures;
	if (t != null)
	    throw t;
    }