[
https://issues.apache.org/jira/browse/TINKERPOP-2830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17786454#comment-17786454
]
ASF GitHub Bot commented on TINKERPOP-2830:
-------------------------------------------
vkagamlyk commented on code in PR #2328:
URL: https://github.com/apache/tinkerpop/pull/2328#discussion_r1394561929
##########
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java:
##########
@@ -349,6 +368,28 @@ private void shouldStoreUserAgentInContext() throws
InterruptedException {
}
}
+ private void shouldStoreUserAgentInHttpContext() throws
InterruptedException {
+ if(server.getChannelizer() instanceof TestChannelizer) {
+ TestChannelizer channelizer = (TestChannelizer)
server.getChannelizer();
+ channelizer.resetChannelHandlerContext();
+ assertNull(getUserAgentIfAvailable());
+ final Cluster cluster = TestClientFactory.build()
+
.channelizer(org.apache.tinkerpop.gremlin.driver.Channelizer.HttpChannelizer.class)
+ .enableUserAgentOnConnect(true)
+ .create();
+ final Client client = cluster.connect();
+
+ client.submit("g.V()");
+ java.lang.Thread.sleep(2000);
+ assertEquals(UserAgent.USER_AGENT, getUserAgentIfAvailable());
+ client.submit("g.V()");
+ java.lang.Thread.sleep(2000);
Review Comment:
Test adds 4 seconds to total test execution time.
Can you replace this condition with checking userAgent every 50-100ms, but
no longer than 2 seconds?
> Handle User-Agent from HTTP Requests to server
> ----------------------------------------------
>
> Key: TINKERPOP-2830
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2830
> Project: TinkerPop
> Issue Type: Improvement
> Components: server
> Affects Versions: 3.5.4
> Reporter: Cole Greer
> Priority: Critical
>
> Changes are being introduced in
> [2480|https://issues.apache.org/jira/browse/TINKERPOP-2480] which add a user
> agent which is sent as a request header during web socket handshakes.
> Originally 2480 was planned to also include the server accepting user agents
> from http requests but this has now fallen outside of the scope. This ticket
> is to complete the user agent feature by adding the ability for the server to
> accept user agents in http requests in addition to web sockets.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)