Some of my tests fail all the time with the following error:
Errno::EADDRNOTAVAIL: Failed to open TCP connection to localhost:9200 (Cannot assign requested address - connect(2) for "localhost" port 9200)
It feels like the test before has not closed its connection so that this test couldn’t be executed. They are both Selenium and Unit tests.
My test setup is the following:
test: docker: - image: circleci/ruby:2.3-browsers environment: DB_HOST: 127.0.0.1 DB_NAME: db DB_USER: u DB_PW: RAILS_ENV: test - image: circleci/postgres:9.6-alpine environment: POSTGRES_USER: u POSTGRES_DB: db POSTGRES_PASSWORD: steps: - checkout - run: name: Install gems command: | bundle install --path vendor/bundle --without development production - run: name: Setup DB command: | rails db:create rails db:schema:load - run: name: Run tests command: rake
Does anyone know how to fix the issue?