Skip to content

Commit 44b6781

Browse files
fix(ReplicatorTestCase): Start host before GetTestServer()
When using HostBuilder, GetTestServer() requires the host to be explicitly started first — unlike the legacy WebHostBuilder which started it implicitly. Add host.Start() before GetTestServer() calls in both branches (startup class and middleware).
1 parent 7e826ad commit 44b6781

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/Lucene.Net.Tests.Replicator/ReplicatorTestCase.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public static TestServer NewHttpServer(IReplicationService service, MockErrorCon
107107
});
108108

109109
var host = hostBuilder.Build();
110+
host.Start();
110111
var server = host.GetTestServer();
111112
server.BaseAddress = new Uri("http://localhost" + ReplicationService.REPLICATION_CONTEXT);
112113
return server;
@@ -167,6 +168,7 @@ public static TestServer NewHttpServer(IReplicationService service, MockErrorCon
167168
});
168169

169170
var host = hostBuilder.Build();
171+
host.Start();
170172
return host.GetTestServer();
171173
}
172174
}

0 commit comments

Comments
 (0)