Skip to content

Commit 0a9e109

Browse files
committed
Fix unit tests: use mock gRPC client to avoid network calls
1 parent 03fbb06 commit 0a9e109

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/Weaviate.Client.Managed.Tests/Mocks/MockWeaviateClient.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ public static (WeaviateClient Client, MockHttpMessageHandler Handler) CreateWith
3030
}
3131
);
3232

33-
var config = new ClientConfiguration
34-
{
35-
RestAddress = "localhost",
36-
GrpcAddress = "localhost",
37-
HttpMessageHandler = mockHandler,
38-
};
33+
// Create a no-op gRPC channel to avoid network calls
34+
var grpcChannel = NoOpGrpcChannel.Create();
35+
var grpcClient = new Grpc.WeaviateGrpcClient(grpcChannel);
3936

40-
var client = new WeaviateClient(config);
37+
// Pass the mock gRPC client to avoid health check failures
38+
var client = new WeaviateClient(httpMessageHandler: mockHandler, grpcClient: grpcClient);
4139

4240
return (client, mockHandler);
4341
}

0 commit comments

Comments
 (0)