Connection Leak Test
A simple project with a connection leak and tests that fail (in different ways) because of it.
See my blog for info on why this project was created.
- User requests the health-check page of our Connection Leak App. The health-check resource reports on the application's health by testing all down stream dependencies. In this case, our app depends on useful service.
- The code then sends a request to the version resource of the Useful service.
- Our app receives a 200 response with the version of the service in the body "1.1". Our app fails to close the connection that was used to send this request.
- Our app responds with a 200 status code and some json stating that the app is OK.
##Fix the Acceptance tests Go to ConnectionLeakApp.java and replace this line:
environment.healthChecks().register(USEFUL_SERVICE_HEALTH_CHECK, new UsefulServiceHealthCheckWithConnectionLeak(client, new URI(AppConfig.USEFUL_SERVICE_VERSION_URI)));
environment.healthChecks().register(USEFUL_SERVICE_HEALTH_CHECK, new UsefulServiceHealthCheckWithNoConnectionLeak(client, new URI(AppConfig.USEFUL_SERVICE_VERSION_URI)));