tlasica commented on a change in pull request #870:
URL: https://github.com/apache/cassandra/pull/870#discussion_r571893503
##########
File path:
test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java
##########
@@ -269,6 +276,59 @@ public void testCreateAlterKeyspaces() throws Throwable
"max_threshold", "32")));
}
+ @Test
+ public void testCreateAlterKeyspacesRFWarnings() throws Throwable
+ {
+ requireNetwork();
+ Thread.sleep(1000); // Hack: requireNetwork() will clear warnings
async so give some time to complete
+
+ // NTS
+ ClientWarn.instance.captureWarnings();
+ String ks = createKeyspace("CREATE KEYSPACE %s WITH replication =
{'class' : 'NetworkTopologyStrategy', '" + DATA_CENTER + "' : 3 }");
+ List<String> warnings = ClientWarn.instance.getWarnings();
+ assertEquals(1, warnings.size());
+ Assertions.assertThat(warnings.get(0)).contains("Your replication
factor 3 for keyspace " + ks + " is higher than the number of nodes 1 for
datacenter " + DATA_CENTER);
+
+ ClientWarn.instance.captureWarnings();
+ execute("CREATE TABLE " + ks + ".t (k int PRIMARY KEY, v int)");
+ warnings = ClientWarn.instance.getWarnings();
+ assertNull(warnings);
+
+ ClientWarn.instance.captureWarnings();
Review comment:
up to you
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]