This is an automated email from the ASF dual-hosted git repository.
ifesdjeen pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push:
new c263cdf610 Fix ProgressBarrierTest
c263cdf610 is described below
commit c263cdf6106adbf706bb85991e103e2c6519946c
Author: Alex Petrov <[email protected]>
AuthorDate: Tue Aug 20 16:39:16 2024 +0200
Fix ProgressBarrierTest
Patch by Alex Petrov; reviewed by Marcus Eriksson for CASSANDRA-19849.
---
.../org/apache/cassandra/tcm/sequences/ProgressBarrierTest.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git
a/test/unit/org/apache/cassandra/tcm/sequences/ProgressBarrierTest.java
b/test/unit/org/apache/cassandra/tcm/sequences/ProgressBarrierTest.java
index 92610ce6d3..c5bf2c129b 100644
--- a/test/unit/org/apache/cassandra/tcm/sequences/ProgressBarrierTest.java
+++ b/test/unit/org/apache/cassandra/tcm/sequences/ProgressBarrierTest.java
@@ -114,7 +114,9 @@ public class ProgressBarrierTest extends CMSTestBase
{
List<TokenPlacementModel.Node> allNodes = new ArrayList<>();
TokenPlacementModel.Node node = null;
- int nodesInCluster = Math.max(rf.total(), nodes.get());
+ // + 1 since one of the nodes will not be joined yet by the
time we create progress barrier, which will fail
+ // a check with ALL.
+ int nodesInCluster = Math.max(rf.total(), nodes.get()) + 1;
for (int i = 1; i <= nodesInCluster; i++)
{
node = nodeFactory.make(i, (i % rf.dcs()) + 1, 1);
@@ -176,7 +178,7 @@ public class ProgressBarrierTest extends CMSTestBase
Assert.assertTrue(String.format("Should have
collected at least %d nodes but got %d." +
"\nRF: %s" +
"\nReplicas: %s" +
- "\nNodes: %s",
expected, collected.size(), rf, replicas, collected),
+ "\nNodes: %s",
expected, collected.size(), rf, replicas, collected),
collected.size() >= expected);
break;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]