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() conn, err := listener.Accept()
if err != nil { if err != nil {
log.Printf("listener error: %v\n", err) log.Printf("listener error: %v\n", err)
continue return
} }
// Read loop for connection // Read loop for connection
go server.handleConnection(conn) go server.handleConnection(conn)

View File

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