grpc-go
grpc-go copied to clipboard
Add a test for the initial channel state while waiting for the first name resolver update
I don't think this is currently tested, and I'm not clear whether we have a bug. We should have a test that does the following:
- Create a channel with a manual name resolver set to not produce any updates when constructed.
- Confirm the channel's
State()==Idle. - Two forks for this test:
- Call
ClientConn.Connect()and confirm the channel'sState()==Connectingimmediately upon returning. (It's possible this is racy but it should not be.) - Perform an RPC, which will block since the name resolver never produced anything. In a separate goroutine, confirm the state eventually changes to
Connectingusingtestutils.AwaitState.
- Call
- Call
internal.EnterIdleModeForTestingand then perform (2) and (3) above.
@arjan-bal Please assign me this issue.
The test is done. However it seems we have a bug, so the test is disabled.