@Test
    public void shouldEventuallySucceedAfterChannelLevelError() {
        final Cluster cluster = TestClientFactory.build()
                .reconnectInterval(500)
                .maxResponseContentLength(32).create(); // Warning: compression can change the content length. Adjust as needed.
        final Client client = cluster.connect();

        try {
            try {
                client.submit("g.inject('x').repeat(concat('x')).times(512)").all().get();
                fail("Request should have failed because it exceeded the max content length allowed");
            } catch (Exception ex) {
                final Throwable root = ExceptionHelper.getRootCause(ex);
                assertThat(root.getMessage(), containsString("Response entity too large"));
            }

            assertEquals(2, client.submit("g.inject(2)").all().join().get(0).getInt());

        } finally {
            cluster.close();
        }
    }
Configure specific Gremlin Server settings for specific tests.
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java