(ctx context.Context, nodeID uint64)
| 88 | } |
| 89 | |
| 90 | func (c *TestCluster) RemoveNode(ctx context.Context, nodeID uint64) error { |
| 91 | var node *Node |
| 92 | for i, n := range c.nodes { |
| 93 | if n.config.ID == nodeID { |
| 94 | node = n |
| 95 | c.nodes = append(c.nodes[:i], c.nodes[i+1:]...) |
| 96 | break |
| 97 | } |
| 98 | } |
| 99 | if len(c.nodes) == 0 || node == nil { |
| 100 | return nil |
| 101 | } |
| 102 | return node.RemovePeer(ctx, nodeID) |
| 103 | } |
| 104 | |
| 105 | func (c *TestCluster) SetSnapshotThreshold(threshold uint64) { |
| 106 | for _, n := range c.nodes { |
no test coverage detected