diff --git a/testing/trino-testing/pom.xml b/testing/trino-testing/pom.xml
index 87a34ea616c0..fcc74b3b8cbc 100644
--- a/testing/trino-testing/pom.xml
+++ b/testing/trino-testing/pom.xml
@@ -57,6 +57,11 @@
configuration
+
+ io.airlift
+ http-server
+
+
io.airlift
log
@@ -200,6 +205,12 @@
assertj-core
+
+ org.eclipse.jetty
+ jetty-server
+ 12.0.9
+
+
org.jdbi
jdbi3-core
@@ -246,4 +257,4 @@
test
-
\ No newline at end of file
+
diff --git a/testing/trino-testing/src/main/java/io/trino/testing/DistributedQueryRunner.java b/testing/trino-testing/src/main/java/io/trino/testing/DistributedQueryRunner.java
index 67c8f6be2c0c..471bd91f6e2d 100644
--- a/testing/trino-testing/src/main/java/io/trino/testing/DistributedQueryRunner.java
+++ b/testing/trino-testing/src/main/java/io/trino/testing/DistributedQueryRunner.java
@@ -20,6 +20,7 @@
import com.google.inject.Key;
import com.google.inject.Module;
import io.airlift.discovery.server.testing.TestingDiscoveryServer;
+import io.airlift.http.server.HttpServer;
import io.airlift.log.Logger;
import io.airlift.log.Logging;
import io.opentelemetry.sdk.testing.exporter.InMemorySpanExporter;
@@ -57,10 +58,13 @@
import io.trino.sql.planner.Plan;
import io.trino.testing.containers.OpenTracingCollector;
import io.trino.transaction.TransactionManager;
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.Server;
import org.intellij.lang.annotations.Language;
import java.io.IOException;
import java.io.UncheckedIOException;
+import java.lang.reflect.Field;
import java.net.URI;
import java.nio.file.Path;
import java.util.HashMap;
@@ -79,6 +83,7 @@
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.base.Throwables.throwIfUnchecked;
import static com.google.common.base.Verify.verify;
+import static com.google.common.collect.Iterables.getOnlyElement;
import static com.google.inject.util.Modules.EMPTY_MODULE;
import static io.airlift.log.Level.DEBUG;
import static io.airlift.log.Level.ERROR;
@@ -88,7 +93,9 @@
import static io.trino.execution.querystats.PlanOptimizersStatsCollector.createPlanOptimizersStatsCollector;
import static java.lang.Boolean.parseBoolean;
import static java.lang.System.getenv;
+import static java.util.Arrays.asList;
import static java.util.Objects.requireNonNull;
+import static org.assertj.core.api.Assertions.assertThat;
public class DistributedQueryRunner
implements QueryRunner
@@ -100,7 +107,7 @@ public class DistributedQueryRunner
private TestingDiscoveryServer discoveryServer;
private TestingTrinoServer coordinator;
private Optional backupCoordinator;
- private Runnable registerNewWorker;
+ private Consumer