Shutdown raft nodes from the last one to the first one in echovault tests. This is to ensure the leader node is shutdown last.

This commit is contained in:
Kelvin Clement Mwinuka
2024-06-02 15:44:09 +08:00
parent bbc53ffee5
commit 166e9a81fb
3 changed files with 805 additions and 805 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -396,7 +396,7 @@ func (server *EchoVault) startTCP() {
conn, err := listener.Accept()
if err != nil {
log.Printf("listener error: %v\n", err)
continue
return
}
// Read loop for connection
go server.handleConnection(conn)

View File

@@ -221,12 +221,12 @@ func Test_Cluster(t *testing.T) {
return
}
defer func() {
for _, node := range nodes {
_ = node.raw.Close()
node.server.ShutDown()
t.Cleanup(func() {
for i := len(nodes) - 1; i > -1; i-- {
_ = nodes[i].raw.Close()
nodes[i].server.ShutDown()
}
}()
})
// Prepare the write data for the cluster.
tests := map[string][]struct {