Skip to content

fix flaky CI tests - #2670

Merged
henderkes merged 16 commits into
mainfrom
fix/flaky-windows
Sep 24, 2026
Merged

henderkes merged 16 commits into
mainfrom
fix/flaky-windows

Conversation

@henderkes

@henderkes henderkes commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Uh, looks like php 8.5 jit has a race condition that occasionally fails our tests.

Load each test configuration directly and stop the admin endpoint and HTTP listeners during cleanup. This avoids the shared Windows listener deadline race caused by reloading the previous test server and removes unbounded HTTP diagnostic requests. Wait for listener release before reusing ports and cover that lifecycle with a regression test.
The SSE subscription can become ready before the native file watcher installs its watches. Direct Caddy startup exposed this race in Linux CI, where the single file creation was missed. Retry file updates past watcher startup and report SSE read errors on the test goroutine while keeping the request deadline and cancellation.
@henderkes henderkes changed the title fix flaky windows test tineouts fix flaky CI tests Sep 23, 2026
@henderkes
henderkes marked this pull request as ready for review September 23, 2026 19:03
@henderkes
henderkes requested a lite review from Copilot September 23, 2026 19:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

馃數 Needs a closer look

Two moderate issues in caddy/testserver_test.go remain unresolved around listener detection and server readiness.

Review effort: Lite
Findings: None

What changed in this PR

This PR reduces CI flakiness by improving Caddy test-server lifecycle synchronization and disabling PHP JIT in CI.

Changes:

  • Adds shared server initialization and listener cleanup.
  • Improves startup, hot-reload, and goroutine synchronization.
  • Disables PHP JIT in the shared CI setup action.
File Reviewed changes
caddy/鈥媤atcher_test.go Uses shared server initialization.
caddy/鈥媡estserver_test.go Adds server setup and listener cleanup helpers.
caddy/鈥媘odule_test.go Uses shared server initialization.
caddy/鈥媓otreload_test.go Improves reload and SSE synchronization.
caddy/鈥媍addy_test.go Uses the helper and hardens request and goroutine cleanup.
caddy/鈥媋dmin_test.go Waits for PHP thread readiness.
.github/鈥媋ctions/鈥媠etup-php/鈥媋ction.yaml Disables PHP JIT in CI.

馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@henderkes
henderkes merged commit bac780f into main Sep 24, 2026
34 checks passed
@henderkes
henderkes deleted the fix/flaky-windows branch September 24, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants