tests: forcestop member procs with signal kill

When the linearizability test cases run with three members, it might take
7-8s to stop three members, especially stopping the leader. The leader
will transfer the leadership and it might take more time to stop peer
listener.

In order to reduce the runtime, this commit is using signal kill to force
stop members instead of graceful shutdown.

REF: #15086

Signed-off-by: Wei Fu <fuweid89@gmail.com>
dependabot/go_modules/go.uber.org/atomic-1.10.0
Wei Fu 2023-02-03 22:24:41 +08:00
parent fa527c5e54
commit 2183a55b47
1 changed files with 9 additions and 1 deletions

View File

@ -163,7 +163,7 @@ func TestLinearizability(t *testing.T) {
retries: 3,
waitBetweenTriggers: waitBetweenFailpointTriggers,
}, *scenario.traffic)
clus.Stop()
forcestopCluster(clus)
longestHistory, remainingEvents := pickLongestHistory(events)
validateEventsMatch(t, longestHistory, remainingEvents)
operations = patchOperationBasedOnWatchEvents(operations, longestHistory)
@ -455,3 +455,11 @@ func testResultsDirectory(t *testing.T) (string, error) {
}
return path, nil
}
// forcestopCluster stops the etcd member with signal kill.
func forcestopCluster(clus *e2e.EtcdProcessCluster) error {
for _, member := range clus.Procs {
member.Kill()
}
return clus.Stop()
}