Github user pluradj commented on a diff in the pull request:
https://github.com/apache/incubator-tinkerpop/pull/122#discussion_r43218601
--- Diff:
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
---
@@ -562,4 +568,98 @@ public void shouldBlockWhenMaxConnectionsExceeded()
throws Exception {
cluster.close();
}
}
+
+ @Test
+ public void
shouldExecuteInSessionAndSessionlessWithoutOpeningTransactionWithSingleClient()
throws Exception {
+ assumeNeo4jIsPresent();
+
+ final SimpleClient client = new WebSocketClient();
+
+ //open a transaction, create a vertex, commit
+ final CountDownLatch latch = new CountDownLatch(1);
+ final RequestMessage OpenRequest =
RequestMessage.build(Tokens.OPS_EVAL)
+ .processor("session")
+ .addArg(Tokens.ARGS_SESSION, name.getMethodName())
+ .addArg(Tokens.ARGS_GREMLIN, "graph.tx().open()")
+ .create();
+ client.submit(OpenRequest, (r) -> {
+ latch.countDown();
+ });
+ assertTrue(latch.await(1500, TimeUnit.MILLISECONDS));
+
+ final CountDownLatch latch2 = new CountDownLatch(1);
+ final RequestMessage AddRequest =
RequestMessage.build(Tokens.OPS_EVAL)
+ .processor("session")
+ .addArg(Tokens.ARGS_SESSION, name.getMethodName())
+ .addArg(Tokens.ARGS_GREMLIN,
"v=graph.addVertex(\"name\",\"stephen\")")
+ .create();
+ client.submit(AddRequest, (r) -> {
+ latch2.countDown();
+ });
+ assertTrue(latch2.await(1500, TimeUnit.MILLISECONDS));
+
+ final CountDownLatch latch3 = new CountDownLatch(1);
+ final RequestMessage CommitRequest =
RequestMessage.build(Tokens.OPS_EVAL)
+ .processor("session")
+ .addArg(Tokens.ARGS_SESSION, name.getMethodName())
+ .addArg(Tokens.ARGS_GREMLIN, "graph.tx().commit()")
+ .create();
+ client.submit(CommitRequest, (r) -> {
+ latch3.countDown();
+
+ });
+ latch3.await(1500, TimeUnit.MILLISECONDS);
--- End diff --
Should this be `assertTrue(latch3.await(1500, TimeUnit.MILLISECONDS));` ?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---