This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch ci-fix
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


The following commit(s) were added to refs/heads/ci-fix by this push:
     new 22d1605  close
22d1605 is described below

commit 22d16058f03f3f07b81640be2cbeacc814463973
Author: Stephen Mallette <[email protected]>
AuthorDate: Wed Dec 29 10:32:04 2021 -0500

    close
---
 .../gremlin/server/GremlinServerIntegrateTest.java | 31 +++++++++++++++++++---
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git 
a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
 
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index 8a63694..45ada8d 100644
--- 
a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
+++ 
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
@@ -267,6 +267,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
             assertThat(t, instanceOf(ResponseException.class));
             assertEquals(ResponseStatusCode.SERVER_ERROR_TIMEOUT, 
((ResponseException) t).getResponseStatusCode());
         }
+
+        g.close();
     }
 
     @Test
@@ -285,7 +287,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
 
     @Test
     public void shouldPingChannelIfClientDies() throws Exception {
-        final Client client = 
TestClientFactory.build().maxConnectionPoolSize(1).minConnectionPoolSize(1).keepAliveInterval(0).create().connect();
+        final Cluster cluster = 
TestClientFactory.build().maxConnectionPoolSize(1).minConnectionPoolSize(1).keepAliveInterval(0).create();
+        final Client client = cluster.connect();
         client.submit("1+1").all().get();
 
         // since we do nothing for 3 seconds and the time limit for ping is 1 
second we should get *about* 3 pings -
@@ -293,7 +296,7 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
         // there record
         Thread.sleep(3000);
 
-        client.close();
+        cluster.close();
 
         // stop the server to be sure that logs flush
         stopServer();
@@ -327,6 +330,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
             assertThat(t, instanceOf(ResponseException.class));
             assertEquals(ResponseStatusCode.SERVER_ERROR_TIMEOUT, 
((ResponseException) t).getResponseStatusCode());
         }
+
+        g.close();
     }
 
     @Test
@@ -355,10 +360,12 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
             assertThat(t, instanceOf(ResponseException.class));
             assertEquals(ResponseStatusCode.SERVER_ERROR_TIMEOUT, 
((ResponseException) t).getResponseStatusCode());
         }
+
+        g.close();
     }
 
     @Test
-    public void shouldTimeOutRemoteTraversalWithPerRequestOption() {
+    public void shouldTimeOutRemoteTraversalWithPerRequestOption() throws 
Exception {
         final GraphTraversalSource g = traversal().withRemote(conf);
 
         try {
@@ -383,6 +390,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
             assertThat(t, instanceOf(ResponseException.class));
             assertEquals(ResponseStatusCode.SERVER_ERROR_TIMEOUT, 
((ResponseException) t).getResponseStatusCode());
         }
+
+        g.close();
     }
 
     @Test
@@ -980,6 +989,7 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
         g.addV("person").property("age", 20).iterate();
         g.addV("person").property("age", 10).iterate();
         assertEquals(50L, 
g.V().hasLabel("person").map(Lambda.function("it.get().value('age') + 
10")).sum().next());
+        g.close();
     }
 
     @Test
@@ -1018,6 +1028,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
         gdotv.toList();
         final DriverRemoteTraversalSideEffects gdotvSe = 
(DriverRemoteTraversalSideEffects) gdotv.asAdmin().getSideEffects();
         assertThat(gdotvSe.statusAttributes().containsKey(Tokens.ARGS_HOST), 
is(true));
+
+        g.close();
     }
 
     @Test
@@ -1068,6 +1080,9 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
             error = true;
         }
         assertThat(error, is(true));
+
+        g.close();
+        cluster.close();
     }
 
     @Test
@@ -1110,6 +1125,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
 
         final BulkSet localBSideEffects = se.get("b");
         assertThat(localBSideEffects.isEmpty(), is(false));
+
+        g.close();
     }
 
     @Test
@@ -1152,6 +1169,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
 
         final BulkSet localBSideEffects = se.get("b");
         assertThat(localBSideEffects.isEmpty(), is(false));
+
+        g.close();
     }
 
     @Test
@@ -1163,7 +1182,7 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
         g.addV("person").property("age", 
20).promise(Traversal::iterate).join();
 
         final Traversal<Vertex,Integer> traversal = 
g.V().hasLabel("person").has("age", 20).values("age");
-        int age = traversal.promise(t -> t.next(1).get(0)).join();
+        final int age = traversal.promise(t -> t.next(1).get(0)).join();
         assertEquals(20, age);
         assertEquals(20, (int)traversal.next());
         assertThat(traversal.hasNext(), is(false));
@@ -1174,6 +1193,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
         assertThat(traversalCloned.promise(t -> ((Traversal) 
t).hasNext()).join(), is(false));
 
         assertEquals(3, g.V().promise(Traversal::toList).join().size());
+
+        g.close();
     }
 
     @Test
@@ -1199,6 +1220,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
             fail("Should have tanked out because of number of parameters used 
and size of the compile script");
         } catch (Exception ex) {
             assertThat(ex.getMessage(), containsString("The Gremlin statement 
that was submitted exceeds the maximum compilation size allowed by the JVM"));
+        } finally {
+            cluster.close();
         }
     }
 }

Reply via email to