• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

medplum / medplum / 29051108017
92%

Build:
DEFAULT BRANCH: main
Ran 09 Jul 2026 09:26PM UTC
Jobs 1
Files 835
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Jul 2026 09:10PM UTC coverage: 91.93% (-0.002%) from 91.932%
29051108017

push

github

web-flow
test(agent,hl7): fix flaky `getFreePort` port collision (#9804)

* test(agent): fix flaky getFreePort port collision

getFreePort closed its probe server before returning, so two sequential
calls could be handed the same ephemeral port by the OS. Tests that
allocate multiple ports (e.g. the 'test' and 'prod' channels in
"Setting a channel.endpoint.status to 'off'") then declared the same
port and app.start() threw a config conflict.

Remember every issued port and hold a probe server open when it lands on
an already-issued port, so the OS can't reissue it in the same round.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Derrick Farris <derrick@medplum.com>

* test(hl7): fix flaky getFreePort port collision

Mirror the agent package fix: getFreePort closed its probe server before
returning, so two sequential calls could be handed the same ephemeral
port by the OS. Remember every issued port and hold a probe server open
when it lands on an already-issued port, so the OS can't reissue it in
the same round.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Derrick Farris <derrick@medplum.com>

* refactor(hl7): export getFreePort from @medplum/hl7 as single impl

The flaky-port fix previously lived duplicated in both the agent and hl7
test-utils. Consolidate it into one implementation in
packages/hl7/src/free-port.ts, exported from the package's public API, and
have both packages import it directly:

- hl7's own tests import from './free-port'
- the agent package imports from '@medplum/hl7'

free-port.ts is a standalone, vitest-free module so it can be exported from
the runtime index without pulling test-only globals into the bundle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Derrick Farris <derrick@medplum.com>

* refactor(hl7): extract MAX_ATTEMPTS constant in free-port

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Derrick Farris <derrick@medplum.com>

*... (continued)

21972 of 24958 branches covered (88.04%)

Branch coverage included in aggregate %.

18 of 21 new or added lines in 1 file covered. (85.71%)

39113 of 41489 relevant lines covered (94.27%)

12419.0 hits per line

Uncovered Changes

Lines Coverage ∆ File
3
80.0
packages/hl7/src/free-port.ts
Jobs
ID Job ID Ran Files Coverage
1 29051108017.1 09 Jul 2026 09:26PM UTC 835
91.93
GitHub Action Run
Source Files on build 29051108017
  • Tree
  • List 835
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #29051108017
  • 80d0585c on github
  • Prev Build on gh-readonly-queue/main/pr-9782-22f29f0a25803ac9c30cad40c97566b11da02f8a (#29037646322)
  • Next Build on main (#29052426328)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc