MCPcopy
hub / github.com/weaviate/weaviate / fakeGRPCReplicationServer

Struct fakeGRPCReplicationServer

adapters/clients/replication_grpc_test.go:49–69  ·  view source on GitHub ↗

── Fake gRPC replication server ───────────────────────────────────────────── fakeGRPCReplicationServer dispatches on request_id to return errors or success, mirroring the REST fakeServer pattern in replication_test.go.

Source from the content-addressed store, hash-verified

47// fakeGRPCReplicationServer dispatches on request_id to return errors or success,
48// mirroring the REST fakeServer pattern in replication_test.go.
49type fakeGRPCReplicationServer struct {
50 pb.UnimplementedReplicationServiceServer
51
52 t *testing.T
53
54 // RequestError is the SimpleReplicaResponse returned for RequestError request_id.
55 requestError *pb.SimpleReplicaResponse
56
57 // internalErrorCount: if > 0, the first N calls with RequestInternalError
58 // return codes.Internal, then succeed. Used for retry testing.
59 internalErrorCount atomic.Int32
60
61 // Pre-configured responses for read operations.
62 fetchObjectData []byte
63 fetchObjectsData []byte
64 digestResponse []*pb.RepairResponse
65 overwriteResults []*pb.RepairResponse
66
67 // commitPayload is the JSON payload returned by Commit on success.
68 commitPayload []byte
69}
70
71func newFakeGRPCReplicationServer(t *testing.T) *fakeGRPCReplicationServer {
72 t.Helper()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected