Skip to content

Commit 74cfcbd

Browse files
committed
Fix Docker health check requests for GLV integration tests
The health checks in the GLV docker-compose files were sending malformed HTTP requests to Gremlin Server which lacked the Content-Type header. This caused the server to mishandle the requests leading to "Connection reset by peer" errors that could interfere with concurrent test execution, producing intermittent NullPointerException failures in random integration tests. Installed curl in the test server Docker image at build time so that health checks no longer need to run "apk add curl" on every invocation. Updated all four GLV docker-compose health checks (dotnet, go, javascript, python) to send properly formed JSON requests with the correct Content-Type header. Also fixed the Python health check which had an unquoted JSON body and an invalid traversal source reference. CTR
1 parent a55c1bf commit 74cfcbd

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

docker/gremlin-test-server/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ RUN chmod 755 /opt/docker-entrypoint.sh
2929

3030
# Installing dos2unix to avoid errors in running the entrypoint script on Windows machines where their
3131
# carriage return is \r\n instead of the \n needed for linux/unix containers
32-
RUN apk update && apk add dos2unix
32+
RUN apk update && apk add dos2unix curl
3333
RUN dos2unix /opt/docker-entrypoint.sh /opt/gremlin-server/bin/gremlin-server.sh && apk del dos2unix
3434

3535
ARG GREMLIN_SERVER

gremlin-dotnet/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ services:
3535
- ${HOME}/.m2:/root/.m2
3636
- ${ABS_PROJECT_HOME}/gremlin-test/target:/opt/gremlin-test
3737
healthcheck:
38-
test: [ "CMD-SHELL", "apk add curl && curl -X POST -d '{\"gremlin\":\"g.inject(1)\"}' http://localhost:45940" ]
38+
test: [ "CMD-SHELL", "curl -sf -X POST -H 'Content-Type: application/json' -d '{\"gremlin\":\"g.inject(1)\"}' http://localhost:45940" ]
3939
interval: 30s
4040
timeout: 10s
4141
retries: 30

gremlin-go/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ services:
3535
- ${HOME}/.m2:/root/.m2
3636
- ${ABS_PROJECT_HOME}/gremlin-test/target:/opt/gremlin-test
3737
healthcheck:
38-
test: [ "CMD-SHELL", "apk add curl && curl -X POST -d '{\"gremlin\":\"g.inject(1)\"}' http://localhost:45940" ]
38+
test: [ "CMD-SHELL", "curl -sf -X POST -H 'Content-Type: application/json' -d '{\"gremlin\":\"g.inject(1)\"}' http://localhost:45940" ]
3939
interval: 30s
4040
timeout: 10s
4141
retries: 30

gremlin-js/gremlin-javascript/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ services:
3535
- ${HOME}/.m2:/root/.m2
3636
- ${ABS_PROJECT_HOME}/gremlin-test/target:/opt/gremlin-test
3737
healthcheck:
38-
test: [ "CMD-SHELL", "apk add curl && curl -X POST -d '{\"gremlin\":\"g.inject(0)\"}' http://localhost:45940" ]
38+
test: [ "CMD-SHELL", "curl -sf -X POST -H 'Content-Type: application/json' -d '{\"gremlin\":\"g.inject(1)\"}' http://localhost:45940" ]
3939
interval: 30s
4040
timeout: 10s
4141
retries: 30

gremlin-python/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ services:
3535
- ${HOME}/.m2:/root/.m2
3636
- ${ABS_PROJECT_HOME}/gremlin-test/target:/opt/gremlin-test
3737
healthcheck:
38-
test: [ "CMD-SHELL", "apk add curl && curl -X POST -d {\"gremlin\":\"gremlin.inject(1)\"} http://localhost:45940" ]
38+
test: [ "CMD-SHELL", "curl -sf -X POST -H 'Content-Type: application/json' -d '{\"gremlin\":\"g.inject(1)\"}' http://localhost:45940" ]
3939
interval: 30s
4040
timeout: 10s
4141
retries: 30

0 commit comments

Comments
 (0)