stayConnected makes cc stay connected by repeatedly calling cc.Connect() until the state becomes Shutdown or until 10 seconds elapses.
(cc *ClientConn)
| 1024 | // stayConnected makes cc stay connected by repeatedly calling cc.Connect() |
| 1025 | // until the state becomes Shutdown or until 10 seconds elapses. |
| 1026 | func stayConnected(cc *ClientConn) { |
| 1027 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 1028 | defer cancel() |
| 1029 | |
| 1030 | for { |
| 1031 | state := cc.GetState() |
| 1032 | switch state { |
| 1033 | case connectivity.Idle: |
| 1034 | cc.Connect() |
| 1035 | case connectivity.Shutdown: |
| 1036 | return |
| 1037 | } |
| 1038 | if !cc.WaitForStateChange(ctx, state) { |
| 1039 | return |
| 1040 | } |
| 1041 | } |
| 1042 | } |
| 1043 | |
| 1044 | func (s) TestURLAuthorityEscape(t *testing.T) { |
| 1045 | tests := []struct { |
no test coverage detected