// act accordingly. We gloss over the fact that some other thread might also have tried to
// interrupt this thread. This shouldn't be a problem in practice, in particular because
// throwing an InterruptedException wouldn't abort the whole test run anyway.
double timeoutSeconds = TimeUtil.toSeconds(timeout.value(), timeout.unit());
String msg = String.format("Method timed out after %1.2f seconds", timeoutSeconds);
SpockTimeoutError error = new SpockTimeoutError(timeoutSeconds, msg);
error.setStackTrace(stackTrace);
throw error;
}
if (saved != null) {
throw saved;
}