mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-05 16:06:57 +08:00
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:
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user