── Fake gRPC replication server ───────────────────────────────────────────── fakeGRPCReplicationServer dispatches on request_id to return errors or success, mirroring the REST fakeServer pattern in replication_test.go.
| 47 | // fakeGRPCReplicationServer dispatches on request_id to return errors or success, |
| 48 | // mirroring the REST fakeServer pattern in replication_test.go. |
| 49 | type 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 | |
| 71 | func newFakeGRPCReplicationServer(t *testing.T) *fakeGRPCReplicationServer { |
| 72 | t.Helper() |
nothing calls this directly
no outgoing calls
no test coverage detected