Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

import com.codahale.metrics.ConsoleReporter;
import com.codahale.metrics.MetricRegistry;
import io.opentracing.Scope;
import io.opentracing.util.GlobalTracer;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.ratis.protocol.ClientId;
Expand Down Expand Up @@ -123,7 +125,13 @@ public void runTests(TaskProvider provider) {

final long counter = i;

//provider is usually a lambda, print out only the owner class name:
String spanName = provider.getClass().getSimpleName().split("\\$")[0];

executor.execute(() -> {
Scope scope =
GlobalTracer.get().buildSpan(spanName)
.startActive(true);
try {

//in case of an other failed test, we shouldn't execute more tasks.
Expand All @@ -134,8 +142,11 @@ public void runTests(TaskProvider provider) {
provider.executeNextTask(counter);
successCounter.incrementAndGet();
} catch (Exception e) {
scope.span().setTag("failure", true);
failureCounter.incrementAndGet();
LOG.error("Error on executing task", e);
} finally {
scope.close();
}
});
}
Expand Down Expand Up @@ -323,6 +334,7 @@ public MetricRegistry getMetrics() {
public OzoneConfiguration createOzoneConfiguration() {
return freonCommand.createOzoneConfiguration();
}

/**
* Simple contract to execute a new step during a freon test.
*/
Expand Down