Skip to content

Commit bd4444a

Browse files
Fix flaky TestServer_RedundantUpdateSuppression. (#8839)
Fixes #7713 The `TestServer_RedundantUpdateSuppression` test was flaky because it began monitoring ClientConn state transitions before the connection had fully stabilized in the expected Ready state. This created a race condition where the monitoring loop could capture initial setup transitions (e.g., Connecting) and falsely report them as unexpected failures caused by the redundant update. Successfully run the test on forge for 1 million times without any flake. RELEASE NOTES: N/A
1 parent 623b3f0 commit bd4444a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎xds/server_resource_ext_test.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,10 @@ func (s) TestServer_RedundantUpdateSuppression(t *testing.T) {
220220
// Start a goroutine to make sure that we do not see any connectivity state
221221
// changes on the client connection. If redundant updates are not
222222
// suppressed, server will recycle client connections.
223+
testutils.AwaitState(ctx, t, cc, connectivity.Ready)
223224
errCh := make(chan error, 1)
224225
go func() {
225-
prev := connectivity.Ready // We know we are READY since we just did an RPC.
226+
prev := connectivity.Ready
226227
for {
227228
curr := cc.GetState()
228229
if !(curr == connectivity.Ready || curr == connectivity.Idle) {

0 commit comments

Comments
 (0)