MCPcopy
hub / github.com/grpc/grpc-go / AwaitNoStateChange

Function AwaitNoStateChange

internal/testutils/state.go:80–85  ·  view source on GitHub ↗

AwaitNoStateChange expects ctx to be canceled before sc's state leaves currState, and fatal errors otherwise.

(ctx context.Context, t *testing.T, sc StateChanger, currState connectivity.State)

Source from the content-addressed store, hash-verified

78// AwaitNoStateChange expects ctx to be canceled before sc's state leaves
79// currState, and fatal errors otherwise.
80func AwaitNoStateChange(ctx context.Context, t *testing.T, sc StateChanger, currState connectivity.State) {
81 t.Helper()
82 if sc.WaitForStateChange(ctx, currState) {
83 t.Fatalf("State changed from %q to %q when no state change was expected", currState, sc.GetState())
84 }
85}

Calls 3

WaitForStateChangeMethod · 0.65
FatalfMethod · 0.65
GetStateMethod · 0.65