MustHavePeer and MustNonePeer should panic after timeout (#207)

This commit is contained in:
Lin ZiHao 2020-06-11 15:50:06 +08:00 committed by GitHub
parent 109bf90f4d
commit 3513f5d1b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -445,6 +445,7 @@ func (c *Cluster) MustHavePeer(regionID uint64, peer *metapb.Peer) {
}
SleepMS(10)
}
panic(fmt.Sprintf("no peer: %v", peer))
}
func (c *Cluster) MustNonePeer(regionID uint64, peer *metapb.Peer) {
@ -464,4 +465,5 @@ func (c *Cluster) MustNonePeer(regionID uint64, peer *metapb.Peer) {
}
SleepMS(10)
}
panic(fmt.Sprintf("have peer: %v", peer))
}