tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject tinkerpop git commit: Changed configuration for some of the session tests
Date Thu, 03 Nov 2016 18:25:19 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/tp32 9e284f7e9 -> 51a14356f


Changed configuration for some of the session tests

At some point the configurations for Gremlin Server session tests got mixed up and it caused
test failures. Also removed pauses in test execution that are no longer necessary now that
session close calls get a confirmation from the server CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/51a14356
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/51a14356
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/51a14356

Branch: refs/heads/tp32
Commit: 51a14356fff39f96018f6f0ed6a0030780e09656
Parents: 9e284f7
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Thu Nov 3 14:23:20 2016 -0400
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Thu Nov 3 14:23:20 2016 -0400

----------------------------------------------------------------------
 .../server/GremlinServerSessionIntegrateTest.java  | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/51a14356/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
index 5a37a99..cc0cb68 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
@@ -85,22 +85,23 @@ public class GremlinServerSessionIntegrateTest  extends AbstractGremlinServerInt
         final String nameOfTest = name.getMethodName();
         switch (nameOfTest) {
             case "shouldHaveTheSessionTimeout":
+            case "shouldCloseSessionOnceOnRequest":
                 settings.processors.clear();
                 final Settings.ProcessorSettings processorSettings = new Settings.ProcessorSettings();
                 processorSettings.className = SessionOpProcessor.class.getCanonicalName();
                 processorSettings.config = new HashMap<>();
                 processorSettings.config.put(SessionOpProcessor.CONFIG_SESSION_TIMEOUT, 3000L);
                 settings.processors.add(processorSettings);
+                Logger.getRootLogger().setLevel(Level.INFO);
                 break;
+            case "shouldBlockAdditionalRequestsDuringClose":
             case "shouldBlockAdditionalRequestsDuringForceClose":
-            case "shouldCloseSessionOnceOnRequest":
                 clearNeo4j(settings);
                 Logger.getRootLogger().setLevel(Level.INFO);
                 break;
             case "shouldEnsureSessionBindingsAreThreadSafe":
                 settings.threadPoolWorker = 2;
                 break;
-            case "shouldBlockAdditionalRequestsDuringClose":
             case "shouldExecuteInSessionAndSessionlessWithoutOpeningTransactionWithSingleClient":
             case "shouldExecuteInSessionWithTransactionManagement":
             case "shouldRollbackOnEvalExceptionForManagedTransaction":
@@ -144,8 +145,7 @@ public class GremlinServerSessionIntegrateTest  extends AbstractGremlinServerInt
         cluster2.close();
 
         // triggered an error during close and since we didn't force close, the attempt to
close the transaction
-        // is made - pause for a moment to be sure the logger gets a chance to propagate
to the recordingAppender
-        Thread.sleep(1000);
+        // is made
         assertThat(recordingAppender.getMessages(), hasItem("INFO - Rolling back open transactions
on graph before killing session: " + name.getMethodName() + "\n"));
 
     }
@@ -172,9 +172,7 @@ public class GremlinServerSessionIntegrateTest  extends AbstractGremlinServerInt
 
         client2.close();
 
-        // because the close was forced, the message should appear immediately but pause
for a second to be
-        // sure it propagates to the recordingAppender
-        Thread.sleep(1000);
+        // because the close was forced, the message should appear immediately
         assertThat(recordingAppender.getMessages(), hasItem("INFO - Skipped attempt to close
open graph transactions on " + name.getMethodName() + " - close was forced\n"));
 
         try {
@@ -245,8 +243,6 @@ public class GremlinServerSessionIntegrateTest  extends AbstractGremlinServerInt
             cluster.close();
         }
 
-        // wait for log to flush before trying to assert log messages
-        Thread.sleep(1000);
         assertEquals(1, recordingAppender.getMessages().stream()
                 .filter(msg -> msg.equals("INFO - Session shouldCloseSessionOnceOnRequest
closed\n")).count());
     }
@@ -282,9 +278,6 @@ public class GremlinServerSessionIntegrateTest  extends AbstractGremlinServerInt
             cluster.close();
         }
 
-        // wait for log to flush before trying to assert log messages
-        Thread.sleep(1000);
-
         // there will be on for the timeout and a second for closing the cluster
         assertEquals(2, recordingAppender.getMessages().stream()
                 .filter(msg -> msg.equals("INFO - Session shouldHaveTheSessionTimeout
closed\n")).count());


Mime
View raw message