jroimartin commented on code in PR #1700:
URL: https://github.com/apache/tinkerpop/pull/1700#discussion_r902485983
##########
gremlin-go/driver/connection_test.go:
##########
@@ -1121,4 +1121,26 @@ func TestConnection(t *testing.T) {
// This routine.
assert.Equal(t, startCount, runtime.NumGoroutine())
})
+
+ t.Run("Test per-request arguments", func(t *testing.T) {
+ skipTestsIfNotEnabled(t, integrationTestSuiteName,
testNoAuthEnable)
+
+ g := getTestGraph(t, testNoAuthUrl, testNoAuthAuthInfo,
testNoAuthTlsConfig)
+ defer g.remoteConnection.Close()
+
+ _, err := g.With("evaluationTimeout",
10).Inject(1).SideEffect(&Lambda{"Thread.sleep(5000)", "gremlin-groovy"}).Next()
+ assert.NotNil(t, err)
+
+ _, err = g.With("evaluationTimeout",
10000).Inject(1).SideEffect(&Lambda{"Thread.sleep(5000)",
"gremlin-groovy"}).Next()
+ assert.Nil(t, err)
+
+ _, err = g.With("evaluationTimeout",
10000).With("evaluationTimeout",
10).Inject(1).SideEffect(&Lambda{"Thread.sleep(5000)", "gremlin-groovy"}).Next()
+ assert.NotNil(t, err)
+
+ _, err =
g.WithStrategies(OptionsStrategy(map[string]interface{}{"evaluationTimeout":
10})).Inject(1).SideEffect(&Lambda{"Thread.sleep(5000)",
"gremlin-groovy"}).Next()
+ assert.NotNil(t, err)
+
+ _, err =
g.WithStrategies(OptionsStrategy(map[string]interface{}{"evaluationTimeout":
10000})).Inject(1).SideEffect(&Lambda{"Thread.sleep(5000)",
"gremlin-groovy"}).Next()
+ assert.Nil(t, err)
+ })
Review Comment:
I pushed 866364c. Is that what you mean?
However, now the test is flaky due to what I think is an unrelated issue.
The gremlin-server fails sometimes with:
```
gremlin-test-server | [ERROR]
GremlinGroovyScriptEngine$GroovyCacheLoader - Script compilation FAILED
gremlinscriptengine__ggremlinscriptengine__g.with.with("evaluationTimeout","evaluationTimeout",10000L10L))..injectinject((1L1L)).sideEffect(.sideEffect({Thread.sleep(5000)}).none(){Thread.sleep(5000)}).none()
took 3ms {}
gremlin-test-server |
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
gremlin-test-server | Script4.groovy: 1: expecting ')', found
'10L' @ line 1, column 102.
gremlin-test-server | ut","evaluationTimeout",10000L10L))..inj
gremlin-test-server | ^
gremlin-test-server |
gremlin-test-server | 1 error
gremlin-test-server |
gremlin-test-server | at
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:311)
gremlin-test-server | at
org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:151)
gremlin-test-server | at
org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:121)
gremlin-test-server | at
org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:133)
...
```
It seems to be trying to compile the following traversal:
`gremlinscriptengine__ggremlinscriptengine__g.with.with("evaluationTimeout","evaluationTimeout",10000L10L))..injectinject((1L1L)).sideEffect(.sideEffect({Thread.sleep(5000)}).none(){Thread.sleep(5000)}).none()`,
which is obviously wrong. I don't know enough about the code base, but it
looks like a data race while building the query string.
I ran the tests against gremlin-server 3.5.3.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]