File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -187,8 +187,18 @@ func TestEtcdClientSync(t *testing.T) {
187187 }
188188 }
189189
190- _ , err = RemoveEtcdMember (client1 , memIDToRemove )
191- re .NoError (err )
190+ // Use testutil.Eventually to handle potential transient errors during member removal.
191+ // The removed member will be shut down immediately, which may cause the removal RPC
192+ // to fail with "server stopped", but we verify success by checking the member list.
193+ testutil .Eventually (re , func () bool {
194+ _ , err := RemoveEtcdMember (client1 , memIDToRemove )
195+ if err == nil {
196+ return true
197+ }
198+ // Verify if the member was actually removed by checking the member list
199+ listResp , listErr := ListEtcdMembers (client1 .Ctx (), client1 )
200+ return listErr == nil && len (listResp .Members ) == 1
201+ })
192202
193203 // Check the client can get the new member with the new endpoints.
194204 checkEtcdEndpointNum (re , client1 , 1 )
You can’t perform that action at this time.
0 commit comments