Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(verifier): acquire HTTP port atomically #1

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

alexeits
Copy link
Collaborator

Acquire the port in VerifyMessageProvider and VerifyProvider atomically by using the listener used for a free port acquisition for the HTTP server.

This prevents a race condition when multiple pact verifiers run in parallel and compete for free ports, which could result in errors like

Expected server to start < 10s. Timed out waiting for http verification proxy on port 34425 - check for errors

@coveralls
Copy link

coveralls commented Sep 25, 2023

Pull Request Test Coverage Report for Build 6305748030

  • 20 of 28 (71.43%) changed or added relevant lines in 2 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.1%) to 77.392%

Changes Missing Coverage Covered Lines Changed/Added Lines %
proxy/http.go 7 10 70.0%
dsl/pact.go 13 18 72.22%
Files with Coverage Reduction New Missed Lines %
proxy/http.go 1 36.04%
dsl/pact.go 3 83.53%
Totals Coverage Status
Change from base Build 6305094254: -0.1%
Covered Lines: 1472
Relevant Lines: 1902

💛 - Coveralls

@alexeits alexeits force-pushed the v1-acquire-ports-atomically branch 2 times, most recently from 0702303 to 593aad9 Compare September 25, 2023 22:27
Acquire the port in VerifyMessageProvider and VerifyProvider atomically
by using the listener used for a free port acquisition for the HTTP server.

This prevents a race condition when multiple pact verifiers run in
parallel and compete for free ports, which could result in errors like

```
Expected server to start < 10s. Timed out waiting for http verification proxy on port 34425 - check for errors
```
@alexeits alexeits merged commit 46ceb7f into v1.x.x Sep 26, 2023
12 checks passed
@alexeits alexeits deleted the v1-acquire-ports-atomically branch October 2, 2023 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants