mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
tests: trigger raftBeforeFollowerSend failpoint in linearizability test
raftBeforeFollowerSend can only be triggered on Follower and won't work on 1 node cluster. Had to split RandomFailpoint into RandomOneNodeClusterFailpoint and RandomMultiNodeClusterFailpoint Signed-off-by: Bogdan Kanivets <bkanivets@apple.com>
This commit is contained in:
parent
586eaccc4d
commit
4b91ae2800
@ -55,7 +55,7 @@ var (
|
||||
RaftBeforeLeaderSendPanic Failpoint = goPanicFailpoint{"raftBeforeLeaderSend", nil, Leader}
|
||||
BlackholePeerNetwork Failpoint = blackholePeerNetworkFailpoint{duration: time.Second}
|
||||
DelayPeerNetwork Failpoint = delayPeerNetworkFailpoint{duration: time.Second, baseLatency: 75 * time.Millisecond, randomizedLatency: 50 * time.Millisecond}
|
||||
RandomFailpoint Failpoint = randomFailpoint{[]Failpoint{
|
||||
oneNodeClusterFailpoints = []Failpoint{
|
||||
KillFailpoint, BeforeCommitPanic, AfterCommitPanic, RaftBeforeSavePanic,
|
||||
RaftAfterSavePanic, DefragBeforeCopyPanic, DefragBeforeRenamePanic,
|
||||
BackendBeforePreCommitHookPanic, BackendAfterPreCommitHookPanic,
|
||||
@ -67,17 +67,18 @@ var (
|
||||
RaftBeforeLeaderSendPanic,
|
||||
BlackholePeerNetwork,
|
||||
DelayPeerNetwork,
|
||||
}}
|
||||
RaftBeforeApplySnapPanic Failpoint = goPanicFailpoint{"raftBeforeApplySnap", triggerBlackholeUntilSnapshot, Follower}
|
||||
RaftAfterApplySnapPanic Failpoint = goPanicFailpoint{"raftAfterApplySnap", triggerBlackholeUntilSnapshot, Follower}
|
||||
RaftAfterWALReleasePanic Failpoint = goPanicFailpoint{"raftAfterWALRelease", triggerBlackholeUntilSnapshot, Follower}
|
||||
RaftBeforeSaveSnapPanic Failpoint = goPanicFailpoint{"raftBeforeSaveSnap", triggerBlackholeUntilSnapshot, Follower}
|
||||
RaftAfterSaveSnapPanic Failpoint = goPanicFailpoint{"raftAfterSaveSnap", triggerBlackholeUntilSnapshot, Follower}
|
||||
RandomSnapshotFailpoint Failpoint = randomFailpoint{[]Failpoint{
|
||||
}
|
||||
RandomOneNodeClusterFailpoint Failpoint = randomFailpoint{oneNodeClusterFailpoints}
|
||||
RaftBeforeFollowerSendPanic Failpoint = goPanicFailpoint{"raftBeforeFollowerSend", nil, Follower}
|
||||
RandomMultiNodeClusterFailpoint Failpoint = randomFailpoint{append(oneNodeClusterFailpoints, RaftBeforeFollowerSendPanic)}
|
||||
RaftBeforeApplySnapPanic Failpoint = goPanicFailpoint{"raftBeforeApplySnap", triggerBlackholeUntilSnapshot, Follower}
|
||||
RaftAfterApplySnapPanic Failpoint = goPanicFailpoint{"raftAfterApplySnap", triggerBlackholeUntilSnapshot, Follower}
|
||||
RaftAfterWALReleasePanic Failpoint = goPanicFailpoint{"raftAfterWALRelease", triggerBlackholeUntilSnapshot, Follower}
|
||||
RaftBeforeSaveSnapPanic Failpoint = goPanicFailpoint{"raftBeforeSaveSnap", triggerBlackholeUntilSnapshot, Follower}
|
||||
RaftAfterSaveSnapPanic Failpoint = goPanicFailpoint{"raftAfterSaveSnap", triggerBlackholeUntilSnapshot, Follower}
|
||||
RandomSnapshotFailpoint Failpoint = randomFailpoint{[]Failpoint{
|
||||
RaftBeforeApplySnapPanic, RaftAfterApplySnapPanic, RaftAfterWALReleasePanic, RaftBeforeSaveSnapPanic, RaftAfterSaveSnapPanic,
|
||||
}}
|
||||
// TODO: Figure out how to reliably trigger below failpoints and add them to RandomFailpoint
|
||||
raftBeforeFollowerSendPanic Failpoint = goPanicFailpoint{"raftBeforeFollowerSend", nil, AnyMember}
|
||||
)
|
||||
|
||||
type Failpoint interface {
|
||||
|
@ -96,7 +96,7 @@ func TestLinearizability(t *testing.T) {
|
||||
for _, traffic := range trafficList {
|
||||
scenarios = append(scenarios, scenario{
|
||||
name: "ClusterOfSize1/" + traffic.name,
|
||||
failpoint: RandomFailpoint,
|
||||
failpoint: RandomOneNodeClusterFailpoint,
|
||||
traffic: &traffic,
|
||||
config: *e2e.NewConfig(
|
||||
e2e.WithClusterSize(1),
|
||||
@ -107,7 +107,7 @@ func TestLinearizability(t *testing.T) {
|
||||
})
|
||||
scenarios = append(scenarios, scenario{
|
||||
name: "ClusterOfSize3/" + traffic.name,
|
||||
failpoint: RandomFailpoint,
|
||||
failpoint: RandomMultiNodeClusterFailpoint,
|
||||
traffic: &traffic,
|
||||
config: *e2e.NewConfig(
|
||||
e2e.WithSnapshotCount(100),
|
||||
|
Loading…
x
Reference in New Issue
Block a user