xiazcy commented on code in PR #1700:
URL: https://github.com/apache/tinkerpop/pull/1700#discussion_r903919770
##########
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:
Thanks @jroimartin! This is interesting. The UnifiedChannelizer is need
because we need the HTTP endpoint to perform the container wait-for check in
docker compose, to make sure server with neo4j transactions is up before
running the integration tests. So we may need to stick with the current
configuration, although this is probably an issue since it doesn't error on the
default web-socket.
Stephen @spmallette would you have any quick thoughts regarding this
floating race condition in UnifiedChannelizer? We could dig into this more and
open a JIRA ticket for it.
In the meanwhile, I think we should get this PR moving forward. And
unfortunately that may mean we submit the requests synchronously and wait on
the err channel of each one, instead of in parallel.
`
err1 := g.With("evaluationTimeout",
10).Inject(1).SideEffect(&Lambda{"Thread.sleep(5000)",
"gremlin-groovy"}).Iterate()
assert.NotNil(t, <-err1)
err2 := g.With("evaluationTimeout",
10000).Inject(1).SideEffect(&Lambda{"Thread.sleep(5000)",
"gremlin-groovy"}).Iterate()
assert.Nil(t, <-err2)
err3 := g.With("evaluationTimeout", 10000).With("evaluationTimeout",
10).Inject(1).SideEffect(&Lambda{"Thread.sleep(5000)",
"gremlin-groovy"}).Iterate()
assert.NotNil(t, <-err3)
err4 :=
g.WithStrategies(OptionsStrategy(map[string]interface{}{"evaluationTimeout":
10})).Inject(1).SideEffect(&Lambda{"Thread.sleep(5000)",
"gremlin-groovy"}).Iterate()
assert.NotNil(t, <-err4)
err5 :=
g.WithStrategies(OptionsStrategy(map[string]interface{}{"evaluationTimeout":
10000})).Inject(1).SideEffect(&Lambda{"Thread.sleep(5000)",
"gremlin-groovy"}).Iterate()
assert.Nil(t, <-err5)
`
--
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]