}
boolean parallelTesting = numClients > 1;
for (int i = 0; i < results.size(); ++i) {
TestResults result = (TestResults) results.get(i);
Trial firstTrial = (Trial) result.getTrials().get(0);
Throwable exception = firstTrial.getException();
// In the case that we're running multiple clients at once, we need to
// let the user know the browser in which the failure happened
if (parallelTesting && exception != null) {
String msg = "Remote test failed at " + result.getHost() + " on "
+ result.getAgent();
if (exception instanceof AssertionFailedError) {
AssertionFailedError newException = new AssertionFailedError(msg
+ "\n" + exception.getMessage());
newException.setStackTrace(exception.getStackTrace());
exception = newException;