In our pipeline we have two defined services, MongoDB and Redis.
Our first step is our backend tests which interact with both these services.
Approximately 20% of the time the step fails with: `MongoError: failed to connect to server [localhost:27017] on first connect` and I have to manually re-run the failed step.
In the screenshot below, multiple tests had already passed which created and closed connections to Mongo, only for it to fail later on. Other times it fails immediately.

pipelines:
default:
- step:
name: Server Test
image: <redacted>
script:
- cd express
- echo $dotenv | base64 -d > .env
- npm install
- npm test
services:
- mongo
- redis
- <other steps redacted>
definitions:
services:
mongo:
image: mongo
redis:
image: redis
Has anyone else come accross this issue?