@Test
    public void shouldContinueToEvalScriptsEvenWithTimedInterrupt() throws Exception {
        final Map<String, Map<String,Object>> config = new HashMap<>();
        final Map<String, Object> scriptPluginConfig = new HashMap<>();
        scriptPluginConfig.put("files", Collections.singletonList(PATHS.get("GremlinExecutorInit.groovy")));
        config.put(ScriptFileGremlinPlugin.class.getName(), scriptPluginConfig);

        final Map<String, Object> groovyPluginConfig = new HashMap<>();
        groovyPluginConfig.put("timedInterrupt", 250);
        config.put(GroovyCompilerGremlinPlugin.class.getName(), groovyPluginConfig);

        final GremlinExecutor gremlinExecutor = GremlinExecutor.build()
                .addPlugins("gremlin-groovy", config)
                .create();

        for (int ix = 0; ix < 5; ix++) {
            try {
                // this script takes significantly longer than the interruptionTimeout
                gremlinExecutor.eval("s = System.currentTimeMillis();\nwhile((System.currentTimeMillis() - s) < 10000) {}").get();
                fail("This should have timed out");
            } catch (Exception se) {
                assertEquals(TimedInterruptTimeoutException.class, se.getCause().getClass());
            }

            // this script takes significantly less than the interruptionTimeout
            assertEquals("test", gremlinExecutor.eval("s = System.currentTimeMillis();\nwhile((System.currentTimeMillis() - s) < 20) {};'test'").get());
        }

        gremlinExecutor.close();
    }
Temporary "useless" plugin definition to force GremlinExecutor to use GremlinScriptEngineManager - will be
removed when the old functionality of ScriptEngines is removed.
gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutorTest.java