Check usage of ports to be forwarded before running E2E test #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ran into a frustrating issue where Docker Compose silently failed to establish a port forward due to an existing Redis instance already running on that port, causing hard to debug test failures. I spent some time working on an improved test setup based on Acyl, but after overcoming several hurdles got stuck on replicating the Envoy configuration, which failed with deprecation errors when running via DQA. Envoy is complex enough that we have decided to wait on putting any more hours into this until we make a longer-term plan for rate limiting.
For now, I've made this PR, which uses
lsof
to check if any of the ports used in the Docker Compose config are already open before running the tests.