Skip to content

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

Open
@dfawley

Description

@dfawley

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: TestingIncludes tests and testing utilities that we have for unit and e2e tests within our repo.P1Type: Testing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions