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)
| 78 | // AwaitNoStateChange expects ctx to be canceled before sc's state leaves |
| 79 | // currState, and fatal errors otherwise. |
| 80 | func 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 | } |