danny0405 commented on a change in pull request #86: [CALCITE-2882] Set dirty
true when open connection
URL: https://github.com/apache/calcite-avatica/pull/86#discussion_r274872221
##########
File path:
server/src/test/java/org/apache/calcite/avatica/remote/RemoteMetaTest.java
##########
@@ -713,6 +713,40 @@ private int getSales(Connection conn, String salesTable,
int productId) throws E
assertEquals(props, originalProps);
}
}
+
+ @Test public void testConnectionPropertiesSync() throws Exception {
+ ConnectionSpec.getDatabaseLock().lock();
+ try {
+ final String t = AvaticaUtils.unique("TEST_CONNECTION_PROPERTIES");
+ AvaticaConnection conn = (AvaticaConnection)
DriverManager.getConnection(url);
+ conn.setAutoCommit(false);
+
+ Statement statement = conn.createStatement();
+ final String create =
+ String.format(Locale.ROOT, "create table if not exists %s ("
+ + " id int not null, msg varchar(255) not null)", t);
+ int status = statement.executeUpdate(create);
+ assertEquals(status, 0);
+
+ Thread.sleep(10000);
+ statement = conn.createStatement();
Review comment:
That really sleep too much time, better to config this timeout params just
in this case and make it fast enough, if it is much slower, maybe you should
add this test case in [1].
[1]
https://github.com/apache/calcite/blob/af97f55f1fcbb3cf6005393dffd91eb345c04b6f/core/src/test/java/org/apache/calcite/test/CalciteSuite.java#L19
----------------------------------------------------------------
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]
With regards,
Apache Git Services