package roundrobin

import "google.golang.org/grpc/internal/testutils/roundrobin"

Package roundrobin contains helper functions to check for roundrobin and weighted-roundrobin load balancing of RPCs in tests.

Index

Functions

func CheckRoundRobinRPCs

func CheckRoundRobinRPCs(ctx context.Context, client testgrpc.TestServiceClient, addrs []resolver.Address) error

CheckRoundRobinRPCs verifies that EmptyCall RPCs on the given ClientConn, connected to a server exposing the test.grpc_testing.TestService, are roundrobined across the given backend addresses.

Returns a non-nil error if context deadline expires before RPCs start to get roundrobined across the given backends.

func CheckWeightedRoundRobinRPCs

func CheckWeightedRoundRobinRPCs(ctx context.Context, client testgrpc.TestServiceClient, addrs []resolver.Address) error

CheckWeightedRoundRobinRPCs verifies that EmptyCall RPCs on the given ClientConn, connected to a server exposing the test.grpc_testing.TestService, are weighted roundrobined (with randomness) across the given backend addresses.

Returns a non-nil error if context deadline expires before RPCs start to get roundrobined across the given backends.

Source Files

roundrobin.go

Version
v1.70.0 (latest)
Published
Jan 23, 2025
Platform
linux/amd64
Imports
10 packages
Last checked
8 minutes ago

Tools for package owners.