Skip to content

MOB-43620 Start Xvfb with -noreset to stop the 56-iteration Chrome hang - #2034

Merged
devership16 merged 3 commits into
masterfrom
MOB-43620_xvfb_noreset
Oct 6, 2026
Merged

devership16 merged 3 commits into
masterfrom
MOB-43620_xvfb_noreset

Conversation

@devership16

@devership16 devership16 commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Jira: https://perforce.atlassian.net/browse/MOB-43620

Problem

Selenium/BPT tests with 1 user per engine fail on exactly iteration 56 and every iteration after it with session not created: DevToolsActivePort file doesn't exist. Chrome itself is fine. It hangs because the virtual display (Xvfb) has stopped responding.

Root cause

  • VirtualDisplay starts Xvfb through pyvirtualdisplay, which sets stderr=PIPE and reads that pipe only in stop().
  • With 1 user, each Chrome quits before the next one starts. Xvfb then has no clients, so it resets after every iteration.
  • On each reset, Xvfb runs xkbcomp. On Ubuntu 24.04 (xkb-data 2.41) that writes ~1.2 KB of Could not resolve keysym warnings to the unread pipe.
  • After ~55 resets the 64 KiB pipe is full. xkbcomp blocks on write, Xvfb waits for it forever, and every later Chrome hangs at X11 init.
  • With ≥2 users per engine, the browsers overlap, so Xvfb rarely resets. That is why only 1-user engines are affected.

This is the "Chrome finally crashed after 55 iterations" from #1983. #1983 fixed the 50-minute hang that came after that crash. This PR fixes the crash itself.

Fix

Start Xvfb with -noreset (Display(size=..., extra_args=["-noreset"])). Per-client X resources are still freed when each client disconnects. This is the same state Xvfb is already in for tests with ≥2 users per engine.

Testing

  • New unit test TestVirtualDisplay.test_xvfb_started_with_noreset.
  • Real pyvirtualdisplay 3.0 SmartDisplay on ubuntu:24.04:
    • master: X connection Bzt moves #56 hangs (xkbcomp in do_wait).
    • this branch: Xvfb runs with -noreset, 150/150 OK.
  • BlazeMeter cloud (current image), 1 user/engine, 5 min:
    • unchanged script, master 83533938: fails at iteration 56.
    • same script holding one X connection open (prevents resets, same effect as -noreset), master 83534208: 123/123 OK.

Each PR must conform to Developer's Guide.

Quick checklist:

  • Description of PR explains the context of change
  • Unit tests cover the change, no broken tests
  • No static analysis warnings (Codacy etc.)
  • Documentation update ('available in the unstable snapshot' warning if necessary) (not needed: no user-facing option)
  • Changes file inside site/dat/docs/changes directory, one-line note of change inside (not added)

🤖 Generated with Claude Code

devership16 and others added 3 commits October 5, 2026 20:00
Root cause of BPT tests failing on exactly iteration 56 with
"DevToolsActivePort file doesn't exist" when an engine runs 1 user:

- pyvirtualdisplay starts Xvfb with stderr=PIPE and only reads it at
  stop() (communicate()).
- With 1 user, Chrome quits before the next starts, so Xvfb hits zero
  clients and resets after every iteration.
- On Ubuntu 24.04 (xkb-data 2.41) every reset makes xkbcomp write
  ~1174 B of "Could not resolve keysym" warnings to that stderr.
- After ~56 resets the 64 KiB pipe is full, xkbcomp blocks on write,
  Xvfb waits on xkbcomp forever and stops accepting connections; every
  later Chrome launch hangs at X11 init and times out after 60s.

Reproduced without Chrome on ubuntu:24.04 Xvfb 21.1.12: X connection
#56 hangs with xkbcomp in do_wait. With -noreset, 300 connections OK.
Matches cloud atop (stuck xkbcomp at the first failure) and why runs
with >=2 users per engine (overlapping Chromes, no resets) never fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 88.24%. Comparing base (3af0054) to head (f3b6a15).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2034   +/-   ##
=======================================
  Coverage   88.24%   88.24%           
=======================================
  Files          75       75           
  Lines       21247    21247           
=======================================
  Hits        18748    18748           
  Misses       2499     2499           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@devership16
devership16 merged commit dcc5d4b into master Oct 6, 2026
3 checks passed
@devership16
devership16 deleted the MOB-43620_xvfb_noreset branch October 6, 2026 09:50
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.

3 participants