Skip to content

fix(router): skip TestRouterNotRebuiltOnHostnameChange on Windows, fixes #8644 (#8649) [skip ci] - #8649

Merged
rfay merged 1 commit into
mainfrom
20260801_rfay_fix_router_race_windows_hang
Aug 2, 2026
Merged

rfay merged 1 commit into
mainfrom
20260801_rfay_fix_router_race_windows_hang

Conversation

@rfay

@rfay rfay commented Aug 1, 2026 •

Copy link
Copy Markdown
Member

The Issue

ddev-windows-mutagen hung for the full 6h go test -timeout in three
consecutive runs (6418, 6419, 6421), always inside
TestRouterNotRebuiltOnHostnameChange, blocked writing a debug log line to
stdout. #8644 mitigated the symptom by capping the pipeline's timeout at 4h,
attributing the hangs to a Docker Desktop 4.84.0 backend regression on the
Windows runner.

The test wraps app2.Start()/app2.Restart() in util.CaptureUserOut().
That helper redirects output to an os.Pipe() that isn't drained until
getOutput() is called - i.e. only after Start()/Restart() returns. With
DDEV_DEBUG=true (set for all CI runs), a full app.Start() can emit enough
debug output to fill that pipe before it returns, deadlocking the write. This
is a known, longstanding Windows limitation of CaptureUserOut():
TestDdevLogs has skipped Windows for the identical reason since 2018. The
new test (added in 6e7e416, merged 2026-07-30) just reintroduced the same
hazard without a Windows guard.

How This PR Solves The Issue

  • pkg/ddevapp/router_test.go: skip TestRouterNotRebuiltOnHostnameChange
    on Windows, following the same pattern (and referencing the same root
    cause) as the existing TestDdevLogs Windows skip.

Manual Testing Instructions

  1. On Windows, run
    go test -v -run TestRouterNotRebuiltOnHostnameChange ./pkg/ddevapp/...
    and confirm it's skipped rather than hanging.
  2. make staticrequired passes.

Automated Testing Overview

No new tests added; TestRouterNotRebuiltOnHostnameChange is now skipped on
Windows where CaptureUserOut() remains unsafe around a full
Start()/Restart().

Release/Deployment Notes

No user-facing behavior change; the skip only affects CI.

@github-actions github-actions Bot added the bugfix label Aug 1, 2026
@github-actions

github-actions Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

@rfay
rfay marked this pull request as ready for review August 1, 2026 23:03
@rfay
rfay requested a review from a team as a code owner August 1, 2026 23:03
 #8644

## The Issue

- Fixes #8644

`ddev-windows-mutagen` hung for the full 6h `go test -timeout` in three
consecutive runs (6418, 6419, 6421), always inside
`TestRouterNotRebuiltOnHostnameChange`, blocked writing a debug log line to
stdout. #8644 mitigated the symptom by capping the pipeline's timeout at 4h,
attributing the hangs to a Docker Desktop 4.84.0 backend regression on the
Windows runner (cross-referencing docker/desktop-feedback#560).

The test wraps `app2.Start()`/`app2.Restart()` in `util.CaptureUserOut()`.
That helper redirects output to an `os.Pipe()` that isn't drained until
`getOutput()` is called - i.e. only after `Start()`/`Restart()` returns. With
`DDEV_DEBUG=true` (set for all CI runs), a full `app.Start()` can emit enough
debug output to fill that pipe before it returns, deadlocking the write. This
is a known, longstanding Windows limitation of `CaptureUserOut()`:
`TestDdevLogs` has skipped Windows for the identical reason since 2018.
`TestRouterNotRebuiltOnHostnameChange` (added in 6e7e416, merged
2026-07-30) just reintroduced the same hazard without a Windows guard.

## How This PR Solves The Issue

- `pkg/ddevapp/router_test.go`: skip `TestRouterNotRebuiltOnHostnameChange`
  on Windows, following the same pattern (and referencing the same root
  cause) as the existing `TestDdevLogs` Windows skip.

## Manual Testing Instructions

1. On Windows, run
   `go test -v -run TestRouterNotRebuiltOnHostnameChange ./pkg/ddevapp/...`
   and confirm it's skipped rather than hanging.
2. `make staticrequired` passes.

## Automated Testing Overview

No new tests added; `TestRouterNotRebuiltOnHostnameChange` is now skipped on
Windows where `CaptureUserOut()` remains unsafe around a full
`Start()`/`Restart()`.

## Release/Deployment Notes

No user-facing behavior change; the skip only affects CI.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@rfay
rfay force-pushed the 20260801_rfay_fix_router_race_windows_hang branch from 260f15f to edf5fcf Compare August 2, 2026 17:26
@rfay rfay changed the title fix(router): skip TestRouterNotRebuiltOnHostnameChange on Windows and fix a router-port race, fixes #8644 fix(router): skip TestRouterNotRebuiltOnHostnameChange on Windows, fixes #8644 Aug 2, 2026
rfay added a commit to rfay/ddev that referenced this pull request Aug 2, 2026
…n Windows

`TestRouterPortSubstitutionPersistsAcrossProjects` wraps `app2.Start()` in
`util.CaptureUserOut()`, the exact pattern ddev#8649 identified as unsafe on
Windows: the helper redirects output to an `os.Pipe()` that isn't drained
until `getOutput()` is called, so a full `Start()` emitting enough
`DDEV_DEBUG` output before returning can deadlock the write. Same root
cause as the existing `TestDdevLogs` and `TestRouterNotRebuiltOnHostnameChange`
Windows skips; this test needs the identical guard.

Co-Authored-By: Claude Fable 5 <[email protected]>
@rfay rfay changed the title fix(router): skip TestRouterNotRebuiltOnHostnameChange on Windows, fixes #8644 fix(router): skip TestRouterNotRebuiltOnHostnameChange on Windows, fixes #8644 (#8649) [skip ci] Aug 2, 2026
@rfay
rfay merged commit a18988f into main Aug 2, 2026
53 of 54 checks passed
@rfay
rfay deleted the 20260801_rfay_fix_router_race_windows_hang branch August 2, 2026 20:59
rfay added a commit to rfay/ddev that referenced this pull request Aug 8, 2026
…n Windows

`TestRouterPortSubstitutionPersistsAcrossProjects` wraps `app2.Start()` in
`util.CaptureUserOut()`, the exact pattern ddev#8649 identified as unsafe on
Windows: the helper redirects output to an `os.Pipe()` that isn't drained
until `getOutput()` is called, so a full `Start()` emitting enough
`DDEV_DEBUG` output before returning can deadlock the write. Same root
cause as the existing `TestDdevLogs` and `TestRouterNotRebuiltOnHostnameChange`
Windows skips; this test needs the identical guard.

Co-Authored-By: Claude Fable 5 <[email protected]>
rfay added a commit to rfay/ddev that referenced this pull request Aug 11, 2026
…n Windows

`TestRouterPortSubstitutionPersistsAcrossProjects` wraps `app2.Start()` in
`util.CaptureUserOut()`, the exact pattern ddev#8649 identified as unsafe on
Windows: the helper redirects output to an `os.Pipe()` that isn't drained
until `getOutput()` is called, so a full `Start()` emitting enough
`DDEV_DEBUG` output before returning can deadlock the write. Same root
cause as the existing `TestDdevLogs` and `TestRouterNotRebuiltOnHostnameChange`
Windows skips; this test needs the identical guard.

Co-Authored-By: Claude Fable 5 <[email protected]>
rfay added a commit to rfay/ddev that referenced this pull request Aug 13, 2026
…n Windows

`TestRouterPortSubstitutionPersistsAcrossProjects` wraps `app2.Start()` in
`util.CaptureUserOut()`, the exact pattern ddev#8649 identified as unsafe on
Windows: the helper redirects output to an `os.Pipe()` that isn't drained
until `getOutput()` is called, so a full `Start()` emitting enough
`DDEV_DEBUG` output before returning can deadlock the write. Same root
cause as the existing `TestDdevLogs` and `TestRouterNotRebuiltOnHostnameChange`
Windows skips; this test needs the identical guard.

Co-Authored-By: Claude Fable 5 <[email protected]>
rfay added a commit to rfay/ddev that referenced this pull request Aug 13, 2026
…n Windows

`TestRouterPortSubstitutionPersistsAcrossProjects` wraps `app2.Start()` in
`util.CaptureUserOut()`, the exact pattern ddev#8649 identified as unsafe on
Windows: the helper redirects output to an `os.Pipe()` that isn't drained
until `getOutput()` is called, so a full `Start()` emitting enough
`DDEV_DEBUG` output before returning can deadlock the write. Same root
cause as the existing `TestDdevLogs` and `TestRouterNotRebuiltOnHostnameChange`
Windows skips; this test needs the identical guard.

Co-Authored-By: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant