You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jh...@apache.org on 2015/09/13 06:30:41 UTC

[4/6] incubator-calcite git commit: Don't assume connection map is already empty

Don't assume connection map is already empty


Project: http://git-wip-us.apache.org/repos/asf/incubator-calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/30453483
Tree: http://git-wip-us.apache.org/repos/asf/incubator-calcite/tree/30453483
Diff: http://git-wip-us.apache.org/repos/asf/incubator-calcite/diff/30453483

Branch: refs/heads/master
Commit: 304534838a20436fd8718d5a5d6f4b7944664b15
Parents: 8f2fa3a
Author: Julian Hyde <jh...@apache.org>
Authored: Thu Sep 10 14:12:21 2015 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Fri Sep 11 13:35:19 2015 -0700

----------------------------------------------------------------------
 .../test/java/org/apache/calcite/avatica/RemoteDriverTest.java    | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/30453483/avatica-server/src/test/java/org/apache/calcite/avatica/RemoteDriverTest.java
----------------------------------------------------------------------
diff --git a/avatica-server/src/test/java/org/apache/calcite/avatica/RemoteDriverTest.java b/avatica-server/src/test/java/org/apache/calcite/avatica/RemoteDriverTest.java
index f2fa8e3..00f7a16 100644
--- a/avatica-server/src/test/java/org/apache/calcite/avatica/RemoteDriverTest.java
+++ b/avatica-server/src/test/java/org/apache/calcite/avatica/RemoteDriverTest.java
@@ -685,6 +685,9 @@ public class RemoteDriverTest {
       Cache<String, Connection> connectionMap =
           QuasiRemoteJdbcServiceFactory.getRemoteConnectionMap(
               (AvaticaConnection) conn1);
+      // Other tests being run might leave connections in the cache.
+      // The lock guards against more connections being cached during the test.
+      connectionMap.invalidateAll();
       assertEquals("connection cache should start empty",
           0, connectionMap.size());
       PreparedStatement conn1stmt1 = conn1.prepareStatement(sql);