Skip to content

Commit

Permalink
mcs: fix unstable panic in tso test (#7433)
Browse files Browse the repository at this point in the history
close #7429

Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 authored Nov 29, 2023
1 parent 7fbe69d commit 90245e3
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions pkg/tso/keyspace_group_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1224,14 +1224,12 @@ func waitForPrimariesServing(
re *require.Assertions, mgrs []*KeyspaceGroupManager, ids []uint32,
) {
testutil.Eventually(re, func() bool {
for i := 0; i < 100; i++ {
for j, id := range ids {
if member, err := mgrs[j].GetElectionMember(id, id); err != nil || !member.IsLeader() {
return false
}
if _, _, err := mgrs[j].HandleTSORequest(mgrs[j].ctx, id, id, GlobalDCLocation, 1); err != nil {
return false
}
for j, id := range ids {
if member, err := mgrs[j].GetElectionMember(id, id); err != nil || member == nil || !member.IsLeader() {
return false
}
if _, _, err := mgrs[j].HandleTSORequest(mgrs[j].ctx, id, id, GlobalDCLocation, 1); err != nil {
return false
}
}
return true
Expand Down

0 comments on commit 90245e3

Please sign in to comment.