- final long deadline = System.nanoTime() + (DELAY_COUNTER * DEFAULT_DELAY * 1000000L);
- do {
- delayThread(DEFAULT_DELAY);
- if (traceElement.getTrace() != null) {
- return;
+ WaitUtils.waitUntil(new IWaitCondition() {
+ @Override
+ public boolean test() throws Exception {
+ return traceElement.getTrace() != null;
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return "Timeout while waiting for " + traceElement;