# DeletApi error using Testcontainer module for Influxdb

**URL:** <https://community.influxdata.com/t/deletapi-error-using-testcontainer-module-for-influxdb/26154>\
**Category:** InfluxDB 2\
**Tags:** query, java\
**Created:** [August 17, 2022, 5:49pm UTC](https://community.influxdata.com/t/deletapi-error-using-testcontainer-module-for-influxdb/26154 "2022-08-17T17:49:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![williamxo](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@williamxo](https://community.influxdata.com/u/williamxo)\
**Post date:** [August 17, 2022, 5:49pm UTC](https://community.influxdata.com/t/deletapi-error-using-testcontainer-module-for-influxdb/26154/1 "2022-08-17T17:49:33Z")

</div>

Hi Guys,  
I am using Testcontainers module for influxdb (Java) for my IT tests, everything seems to work well except using the deleteApi to drop series ( truncate in-between tests). it has a flaky behaviour

- Works fine when you just run a test.
- Outputs this error “Failed to connect to localhost/127.0.0.1:52491” when you try to run all tests.  
(ProxyAuthenticationRequiredException )

---

<div class="post-metadata">

**Author:** ![williamxo](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@williamxo](https://community.influxdata.com/u/williamxo)\
**Post date:** [August 17, 2022, 7:33pm UTC](https://community.influxdata.com/t/deletapi-error-using-testcontainer-module-for-influxdb/26154/2 "2022-08-17T19:33:21Z")

</div>

Managed to solve the issue apparently my test set up was spinning up a new influxdb container for each class being tested and the url for the influxdb client wasn’t updated so the delete api was calling through a port that was already destroyed hence the failed to connect error.

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [August 17, 2022, 9:55pm UTC](https://community.influxdata.com/t/deletapi-error-using-testcontainer-module-for-influxdb/26154/3 "2022-08-17T21:55:59Z")

</div>

@williamxo Thanks for sharing your solution!
