Skip to content

Commit 098ed7a

Browse files
authored
Review fixes for dropwizard:dropwizard-testing (open-telemetry#17318)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
1 parent 8ef08e3 commit 098ed7a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • instrumentation/dropwizard/dropwizard-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/dropwizard

instrumentation/dropwizard/dropwizard-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/dropwizard/DropwizardAsyncTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.net.URISyntaxException;
2424
import java.util.concurrent.ExecutorService;
2525
import java.util.concurrent.Executors;
26+
import javax.annotation.PreDestroy;
2627
import javax.ws.rs.GET;
2728
import javax.ws.rs.HeaderParam;
2829
import javax.ws.rs.Path;
@@ -63,7 +64,12 @@ public void run(Configuration configuration, Environment environment) {
6364

6465
@Path("/")
6566
public static class AsyncServiceResource {
66-
final ExecutorService executor = Executors.newSingleThreadExecutor();
67+
private final ExecutorService executor = Executors.newSingleThreadExecutor();
68+
69+
@PreDestroy
70+
public void stop() {
71+
executor.shutdown();
72+
}
6773

6874
@GET
6975
@Path("success")

0 commit comments

Comments
 (0)