mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-06 00:16:53 +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()
|
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)
|
||||||
|
@@ -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 {
|
||||||
|
Reference in New Issue
Block a user