Repository navigation
fix flaky CI tests - #2670
Merged
Merged
fix flaky CI tests#2670
Conversation
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.
Run the native extension test in a subprocess so an abrupt Windows exit reports its status even after test output has been printed. Log initialization, signal checks, request handling, and shutdown to identify where the process exits. Keep failures fatal and bound the child test to one minute.
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh, looks like php 8.5 jit has a race condition that occasionally fails our tests.