You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2019/09/09 21:46:20 UTC

[tinkerpop] 04/06: Restored check of GSSException

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

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

commit 542a9f998995bcb00259759e841182f557f2c0af
Author: Stephen Mallette <sp...@genoprime.com>
AuthorDate: Mon Sep 9 16:35:04 2019 -0400

    Restored check of GSSException
    
    Different environments seem to throw that exception from time to time. Not completely clear which ones do and which don't but ever since we started checking those we get much more consistent test runs. Probably need to better trap and unify exceptions in the driver but that's a different story/ticket/jira/issue/whatever CTR
---
 .../tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java | 3 ++-
 .../gremlin/server/GremlinServerAuthKrb5IntegrateTest.java       | 9 ++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
index 79ebcd8..197c623 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
@@ -180,7 +180,8 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
             final Throwable root = ExceptionUtils.getRootCause(ex);
 
             // depending on the configuration of the system environment you might get either of these
-            assertThat(root, anyOf(instanceOf(GSSException.class), instanceOf(ResponseException.class)));
+            assertThat(root, anyOf(instanceOf(GSSException.class), instanceOf(ResponseException.class),
+                                   instanceOf(NoHostAvailableException.class)));
         } finally {
             cluster.close();
         }
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
index 4a7831e..e36db21 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
@@ -30,6 +30,7 @@ import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.server.auth.Krb5Authenticator;
+import org.ietf.jgss.GSSException;
 import org.junit.Before;
 import org.junit.Test;
 import org.slf4j.LoggerFactory;
@@ -47,6 +48,9 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.ExecutionException;
 
 import static org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalSource.traversal;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.AnyOf.anyOf;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -197,7 +201,10 @@ public class GremlinServerAuthKrb5IntegrateTest extends AbstractGremlinServerInt
             fail("This should not succeed as the client config does not contain a JaasEntry");
         } catch(Exception ex) {
             final Throwable root = ExceptionUtils.getRootCause(ex);
-            assertTrue(root instanceof ResponseException || root instanceof NoHostAvailableException);
+
+            // depending on the configuration of the system environment you might get either of these
+            assertThat(root, anyOf(instanceOf(GSSException.class), instanceOf(ResponseException.class),
+                                   instanceOf(NoHostAvailableException.class)));
         } finally {
             cluster.close();
         }