fix(ci): set management.server.port=0 in test profile to fix 25-min test timeout #594

Merged
marcel merged 1 commits from fix/issue-593-management-port-zero into main 2026-05-15 08:55:04 +02:00
Owner

Summary

  • Adds management.server.port: 0 to application-test.yaml so each Spring context binds to a random free port during tests

Root cause

PR #576 added management.server.port: 8081 (fixed port) to application.yaml. Four test classes use @DirtiesContext(AFTER_EACH_TEST_METHOD) which causes ~22 Spring context restarts. Each restart binds port 8081, then releases it — but the OS keeps it in TIME_WAIT for ~45–60 s. The next context startup blocks until the OS releases the port. 22 cycles × ~45 s = ~17 min of overhead. All 1601 tests pass but the surefire 10-min timeout fires before the suite finishes.

Setting port to 0 gives each context a fresh random port — no conflicts, no TIME_WAIT wait, suite returns to ~5 min.

Closes #593.

Test plan

  • Backend Unit Tests CI job completes in under 10 min
  • All 1601 tests pass
## Summary - Adds `management.server.port: 0` to `application-test.yaml` so each Spring context binds to a random free port during tests ## Root cause PR #576 added `management.server.port: 8081` (fixed port) to `application.yaml`. Four test classes use `@DirtiesContext(AFTER_EACH_TEST_METHOD)` which causes ~22 Spring context restarts. Each restart binds port 8081, then releases it — but the OS keeps it in `TIME_WAIT` for ~45–60 s. The next context startup blocks until the OS releases the port. 22 cycles × ~45 s = **~17 min of overhead**. All 1601 tests pass but the surefire 10-min timeout fires before the suite finishes. Setting port to `0` gives each context a fresh random port — no conflicts, no `TIME_WAIT` wait, suite returns to ~5 min. Closes #593. ## Test plan - [ ] Backend Unit Tests CI job completes in under 10 min - [ ] All 1601 tests pass
marcel added 1 commit 2026-05-15 08:53:15 +02:00
fix(ci): set management.server.port=0 in test profile to fix 25-min test timeout
Some checks failed
CI / OCR Service Tests (pull_request) Waiting to run
CI / Backend Unit Tests (pull_request) Waiting to run
CI / fail2ban Regex (pull_request) Waiting to run
CI / Compose Bucket Idempotency (pull_request) Waiting to run
CI / Unit & Component Tests (pull_request) Has been cancelled
CI / Unit & Component Tests (push) Has been cancelled
CI / OCR Service Tests (push) Has been cancelled
CI / Backend Unit Tests (push) Has been cancelled
CI / fail2ban Regex (push) Has been cancelled
CI / Compose Bucket Idempotency (push) Has been cancelled
8a00d66435
Port 8081 was fixed by #576. With four @DirtiesContext(AFTER_EACH_TEST_METHOD)
classes (22 context restarts total), the OS TIME_WAIT state holds port 8081
for ~45-60s per cycle — adding ~17 min overhead. All 1601 tests pass but
surefire's 10-min timeout fires before the suite finishes.

Fixes #593.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
marcel merged commit 8a00d66435 into main 2026-05-15 08:55:04 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marcel/familienarchiv#594