Skip to content

Prevent fixtures web server from blocking on unread output - #67

Merged
aik099 merged 2 commits into
minkphp:mainfrom
aik099:fix/fixture-server-output-blocking
Oct 6, 2026
Merged

aik099 merged 2 commits into
minkphp:mainfrom
aik099:fix/fixture-server-output-blocking

Conversation

@aik099

@aik099 aik099 commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Fixes #64
Closes #48

The test fixtures web server (php -S, started in tests/bootstrap.php) writes an access log line per request to its stderr. The Symfony Process never read that output, so once the OS pipe buffer filled up the server blocked on write() and stopped serving requests. From that point every page load in the browser hung until the 180s WebDriver timeout, failing all remaining tests in the run.

This is why the failures:

  • only happen in the full suite (depends on total request count, not on a specific test);
  • usually land on WindowTest (it's late in the run), but can hit other tests too;
  • were never reproducible locally when running tests in isolation.

Confirmed locally on selenium/standalone-chromium:4: during the hang the fixtures server didn't respond even to curl from the host, and its main thread was stuck in fprintf to stderr. With the fix the full suite passes in ~90s instead of hanging.

Likely also related to #48 (window tests crashing only on GitHub Actions), and to the extra timeouts seen in this CI run of #65.

The remaining Chrome-only Form test failures (page content read before form submission navigation completes) are a separate issue and aren't addressed here.

🤖 Generated with Claude Code

The "php -S" access log was written into a pipe nobody read. Once the
pipe buffer filled up, the server blocked and all further page loads hung.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.06%. Comparing base (66a0bd1) to head (2e34abb).

Additional details and impacted files
@@             Coverage Diff              @@
##               main      #67      +/-   ##
============================================
+ Coverage     88.33%   89.06%   +0.72%     
  Complexity      197      197              
============================================
  Files             1        1              
  Lines           506      494      -12     
============================================
- Hits            447      440       -7     
+ Misses           59       54       -5     
Flag Coverage Δ
chrome 88.46% <ø> (+1.50%) ⬆️
chromium 87.85% <ø> (+4.25%) ⬆️
edge 88.46% <ø> (+4.46%) ⬆️
firefox 88.05% <ø> (+0.70%) ⬆️
selenium-2.53.1 87.04% <ø> (+1.47%) ⬆️
selenium-3 88.05% <ø> (+0.70%) ⬆️
selenium-4 88.66% <ø> (+0.91%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aik099

aik099 commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

Comparison of the reference main build (run) vs this PR (run):

Matrix entries main This PR Result
Selenium 2.53.1: chrome, firefox ✅ pass ✅ pass no change
Selenium 3: chrome, firefox ❌ WindowTest hangs (Resize window, Switching to missing window), 6-12 min ✅ pass, ~1.5 min fixed
Selenium 4: chrome (PHP 7.4-8.3), chromium, edge ❌ WindowTest hangs (3-5 tests) + random Form failures, 12-17 min ❌ random Form failures only, ~2 min hangs fixed
Selenium 4: firefox ❌ WindowTest hangs (Resize window, Switching to missing window) + HoverTest (Double click hover, Right click hover) ❌ HoverTest only hangs fixed
Static analysis ❌ unmatched ignoreErrors patterns ❌ same unrelated

The remaining failures are not caused by this PR and will be addressed separately:

  • random Form failures (1-3 per job, different each run: Submit empty textarea, Advanced form second submit, Basic get form, etc.) - page content is read before form submission navigation completes;
  • HoverTest on Firefox + Selenium 4 - fails consistently;
  • PHPStan ignoreErrors patterns no longer matching.

The freeze was caused by the blocked fixtures web server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aik099

aik099 commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

I've also removed the testDeprecatedShortPageLoadTimeoutThrowsException skip (2e34abb), that was added in #38 (tracked by #48) for Chromium-based browsers and Selenium 2 Firefox on GitHub Actions.

That freeze had the same root cause as the hanging WindowTest: setting page load timeout several times was never a problem by itself, it just added more requests to the fixtures web server, which made its output pipe fill up sooner. That's also why it was "cumulative", only happened on GitHub Actions and never in isolation.

With the skip removed the test passes in all 12 test jobs (run) without any hangs.

@stof

stof commented Oct 5, 2026

Copy link
Copy Markdown
Member

the failure for the form tests in Chrome is caused by this bug in ChromeDriver 134+: https://issues.chromium.org/issues/402796660?pli=1
The last comment on this issue says they have a fix in progress, but it does not seem to be merged yet.

@aik099

aik099 commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

the failure for the form tests in Chrome is caused by this bug in ChromeDriver 134+: https://issues.chromium.org/issues/402796660?pli=1 The last comment on this issue says they have a fix in progress, but it does not seem to be merged yet.

Thank you. The #68 uses the proposed workaround. Ready for review as well.

Merging this one.

@aik099
aik099 merged commit acd45d2 into minkphp:main Oct 6, 2026
42 of 62 checks passed
@aik099
aik099 deleted the fix/fixture-server-output-blocking branch October 6, 2026 08:17
@uuf6429

uuf6429 commented Oct 7, 2026

Copy link
Copy Markdown
Member

The Symfony Process never read that output, so once the OS pipe buffer filled up the server blocked on write() and stopped serving requests.

Nice catch.

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.

The "Switching to missing window" test is failing with Selenium 3 and 4 Investigate GH crashes when page timeout is set multiple times

3 participants