grpc-go icon indicating copy to clipboard operation
grpc-go copied to clipboard

Add a test for the initial channel state while waiting for the first name resolver update

Open dfawley opened this issue 1 year ago • 2 comments

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:

  1. Create a channel with a manual name resolver set to not produce any updates when constructed.
  2. Confirm the channel's State() == Idle.
  3. Two forks for this test:
    1. Call ClientConn.Connect() and confirm the channel's State() == Connecting immediately upon returning. (It's possible this is racy but it should not be.)
    2. Perform an RPC, which will block since the name resolver never produced anything. In a separate goroutine, confirm the state eventually changes to Connecting using testutils.AwaitState.
  4. Call internal.EnterIdleModeForTesting and then perform (2) and (3) above.

dfawley avatar Sep 30 '24 18:09 dfawley

@arjan-bal Please assign me this issue.

janardhanvissa avatar Oct 17 '24 10:10 janardhanvissa

The test is done. However it seems we have a bug, so the test is disabled.

dfawley avatar Nov 19 '24 21:11 dfawley