mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 00:55:55 +00:00
Merge pull request #1394 from travisturner/simplify-addnode
simplify test cluster addNode signature
This commit is contained in:
commit
7eb5118ef0
2 changed files with 13 additions and 13 deletions
|
|
@ -552,7 +552,7 @@ func TestCluster_ResizeStates(t *testing.T) {
|
|||
|
||||
t.Run("Single node, in topology", func(t *testing.T) {
|
||||
tc := NewClusterCluster(0)
|
||||
tc.addNode(false)
|
||||
tc.addNode()
|
||||
|
||||
node := tc.Clusters[0]
|
||||
|
||||
|
|
@ -580,7 +580,7 @@ func TestCluster_ResizeStates(t *testing.T) {
|
|||
|
||||
t.Run("Single node, not in topology", func(t *testing.T) {
|
||||
tc := NewClusterCluster(0)
|
||||
tc.addNode(false)
|
||||
tc.addNode()
|
||||
|
||||
node := tc.Clusters[0]
|
||||
|
||||
|
|
@ -605,14 +605,14 @@ func TestCluster_ResizeStates(t *testing.T) {
|
|||
|
||||
t.Run("Multiple nodes, no data", func(t *testing.T) {
|
||||
tc := NewClusterCluster(0)
|
||||
tc.addNode(false)
|
||||
tc.addNode()
|
||||
|
||||
// Open TestCluster.
|
||||
if err := tc.Open(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
tc.addNode(false)
|
||||
tc.addNode()
|
||||
|
||||
node0 := tc.Clusters[0]
|
||||
node1 := tc.Clusters[1]
|
||||
|
|
@ -643,7 +643,7 @@ func TestCluster_ResizeStates(t *testing.T) {
|
|||
|
||||
t.Run("Multiple nodes, in/not in topology", func(t *testing.T) {
|
||||
tc := NewClusterCluster(0)
|
||||
tc.addNode(false)
|
||||
tc.addNode()
|
||||
node0 := tc.Clusters[0]
|
||||
|
||||
// write topology to data file
|
||||
|
|
@ -664,12 +664,12 @@ func TestCluster_ResizeStates(t *testing.T) {
|
|||
|
||||
// Expect an error by adding a node not in the topology.
|
||||
expectedError := "host is not in topology: node1"
|
||||
err := tc.addNode(false)
|
||||
err := tc.addNode()
|
||||
if err == nil || err.Error() != expectedError {
|
||||
t.Errorf("did not receive expected error: %s", expectedError)
|
||||
}
|
||||
|
||||
tc.addNode(false)
|
||||
tc.addNode()
|
||||
node2 := tc.Clusters[2]
|
||||
|
||||
// Ensure that node comes up in state NORMAL.
|
||||
|
|
@ -687,7 +687,7 @@ func TestCluster_ResizeStates(t *testing.T) {
|
|||
|
||||
t.Run("Multiple nodes, with data", func(t *testing.T) {
|
||||
tc := NewClusterCluster(0)
|
||||
tc.addNode(false)
|
||||
tc.addNode()
|
||||
node0 := tc.Clusters[0]
|
||||
|
||||
// Open TestCluster.
|
||||
|
|
@ -709,8 +709,8 @@ func TestCluster_ResizeStates(t *testing.T) {
|
|||
node0Fragment := node0View.Fragment(1)
|
||||
node0Checksum := node0Fragment.Checksum()
|
||||
|
||||
// AddNode needs to block until the resize process has completed.
|
||||
tc.addNode(false)
|
||||
// addNode needs to block until the resize process has completed.
|
||||
tc.addNode()
|
||||
node1 := tc.Clusters[1]
|
||||
|
||||
// Ensure that nodes come up in state NORMAL.
|
||||
|
|
|
|||
|
|
@ -150,11 +150,11 @@ func (t *ClusterCluster) clusterByID(id string) *Cluster {
|
|||
return nil
|
||||
}
|
||||
|
||||
// AddNode adds a node to the cluster and (potentially) starts a resize job.
|
||||
func (t *ClusterCluster) addNode(saveTopology bool) error {
|
||||
// addNode adds a node to the cluster and (potentially) starts a resize job.
|
||||
func (t *ClusterCluster) addNode() error {
|
||||
id := len(t.Clusters)
|
||||
|
||||
c, err := t.addCluster(id, saveTopology)
|
||||
c, err := t.addCluster(id, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue