Restore ClientBehaviorTests in all GLVs#3436
Open
Cole-Greer wants to merge 3 commits into
Open
Conversation
Replace the old WebSocket behavioral test infrastructure with an HTTP equivalent. The lightweight test server in gremlin-socket-server dispatches on the Gremlin query string to simulate adversarial network conditions. Server changes: - Remove dead WebSocket artifacts (TestHandlers, test-ws-gremlin.yaml) - Replace SocketServerSettings with SocketServerConstants (pure constants) - Rename SimpleSocketServer to SimpleTestServer - Add TestHttpServerInitializer and TestHttpGremlinHandler - Scenarios: single vertex, close connection, vertex-then-close, error after delay, partial content close, malformed response, no response, slow drip-feed, empty body Test changes: - Add ClientBehaviorIntegrateTest in gremlin-driver with 13 tests - Add test-scoped dependency on gremlin-socket-server in gremlin-driver
Add ClientBehaviorIntegrationTests for each GLV against the shared gremlin-socket-server HTTP test server. Each GLV has 12 test scenarios matching the Java ClientBehaviorIntegrateTest (server downtime recovery is skipped since GLVs cannot stop/restart the Docker container). Docker changes: - Add gremlin-socket-server service to all 4 GLV docker-compose files - Set GREMLIN_SOCKET_SERVER_URL env var for test containers - Remove old conf volume mounts (.NET, JS) Python: - Add socket_server_constants.py and test_client_behavior.py - Remove old test_web_socket_client_behavior.py .NET: - Add SocketServerConstants.cs and ClientBehaviorIntegrationTests.cs - Remove old SocketServerSettings.cs and YamlDotNet dependency Go: - Add socket_server_constants_test.go and client_behavior_test.go JavaScript: - Add socket-server-constants.js and client-behavior-tests.js
c952954 to
69e97ab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The 3.8-dev branch had a set of WebSocket behavioral tests (WebSocketClientBehaviorIntegrateTest + a gremlin-socket-server) that validated driver resilience under adverse network conditions — dropped connections, mid-stream failures, slow responses, etc. These were lost in the switch from WebSockets to HTTP.
This PR recreates that coverage for the HTTP/GraphBinary-V4 stack and extends it to all GLVs.
Because requestId was removed from the wire protocol in 4.x, the old UUID-based dispatch mechanism is no longer possible. The test server now dispatches on the Gremlin query string instead (e.g. client.submit("server_close_connection")), which requires no protocol changes and works identically across every GLV.
What's included
Lightweight HTTP test server (gremlin-tools/gremlin-socket-server)
Java driver tests — ClientBehaviorIntegrateTest (13 tests) covering connection drops, server errors, malformed/empty/partial responses, slow streaming, timeouts, connection-pool self-healing, and concurrent mixed good/bad requests, with specific exception-type and message assertions.
All GLVs — equivalent ClientBehavior suites for Python, .NET, Go, and JavaScript, each with a constants file and a gremlin-socket-server service added to its docker-compose. Tests gracefully skip when the server isn't reachable.
Testing
All suites were run through their Docker test harnesses:
Skip rationale:
Audit findings (follow-up tasks)
Running the same scenarios across every GLV surfaced several driver behavior gaps. Alignment is left out of scope of this PR:
VOTE +1