@@ -65,7 +65,7 @@ public void ClusterConfigInitializesUnassignedWorkerTest()
65
65
public void ClusterForgetAfterNodeRestartTest ( )
66
66
{
67
67
int nbInstances = 4 ;
68
- context . CreateInstances ( 4 ) ;
68
+ context . CreateInstances ( nbInstances ) ;
69
69
context . CreateConnection ( ) ;
70
70
var ( shards , slots ) = context . clusterTestUtils . SimpleSetupCluster ( logger : context . logger ) ;
71
71
@@ -77,7 +77,7 @@ public void ClusterForgetAfterNodeRestartTest()
77
77
78
78
var firstNode = context . nodes [ 0 ] ;
79
79
var nodesResult = context . clusterTestUtils . ClusterNodes ( 0 ) ;
80
- Assert . That ( nodesResult . Nodes . Count == 4 ) ;
80
+ Assert . That ( nodesResult . Nodes . Count == nbInstances ) ;
81
81
82
82
try
83
83
{
@@ -96,13 +96,13 @@ public void ClusterForgetAfterNodeRestartTest()
96
96
}
97
97
98
98
nodesResult = context . clusterTestUtils . ClusterNodes ( 0 ) ;
99
- Assert . That ( nodesResult . Nodes . Count == 4 , "No node should've been removed from the cluster after an invalid id was passed." ) ;
99
+ Assert . That ( nodesResult . Nodes . Count == nbInstances , "No node should've been removed from the cluster after an invalid id was passed." ) ;
100
100
Assert . That ( nodesResult . Nodes . ElementAt ( 0 ) . IsMyself ) ;
101
101
Assert . That ( nodesResult . Nodes . ElementAt ( 0 ) . EndPoint . ToIPEndPoint ( ) . Port == 7000 , "Expected the node to be replying to be the one with port 7000." ) ;
102
102
103
103
context . clusterTestUtils . ClusterForget ( 0 , nodesResult . Nodes . Last ( ) . NodeId , 0 ) ;
104
104
nodesResult = context . clusterTestUtils . ClusterNodes ( 0 ) ;
105
- Assert . That ( nodesResult . Nodes . Count == 3 , "A node should've been removed from the cluster." ) ;
105
+ Assert . That ( nodesResult . Nodes . Count == nbInstances - 1 , "A node should've been removed from the cluster." ) ;
106
106
Assert . That ( nodesResult . Nodes . ElementAt ( 0 ) . IsMyself ) ;
107
107
Assert . That ( nodesResult . Nodes . ElementAt ( 0 ) . EndPoint . ToIPEndPoint ( ) . Port == 7000 , "Expected the node to be replying to be the one with port 7000." ) ;
108
108
}
0 commit comments