Skip to content

[ASIM-6255] Revive the build: share one headless Chrome across the test session - #300

Merged
nicoddemus merged 9 commits into
masterfrom
fb-ASIM-6255-qmxgraph-build
Oct 9, 2026
Merged

nicoddemus merged 9 commits into
masterfrom
fb-ASIM-6255-qmxgraph-build

Conversation

@nicoddemus

@nicoddemus nicoddemus commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Revives the CI build (ASIM-6255), which had been timing out and was disabled for months.

The problem: about halfway through the suite Chrome stopped answering chromedriver, and every following test hung on browser startup, got rerun and errored out.

The cause: pytest-selenium launched a new Chrome + chromedriver for every test, and the page fixture forced a 1-second page load timeout with refresh retries. Now a single headless Chrome is shared by the whole session (each test still loads its own page).

Other changes:

  • Migrated to pixi-devenv (including docs).
  • Testing with Python 3.12, 3.13 and 3.14 (docs with 3.12).
  • Reviewed a few tests.
  • test_error_redirection marked xfail: under QtWebEngine 5.15.15 JS errors reach Python as a bare "Script error." (ASIM-6921).

🤖 Generated with Claude Code

@coveralls

coveralls commented Oct 8, 2026 •

Copy link
Copy Markdown

Coverage Status

Coverage is 87.829% — fb-ASIM-6255-qmxgraph-build into master. No base build found for master.

@nicoddemus
nicoddemus force-pushed the fb-ASIM-6255-qmxgraph-build branch from 17ff600 to 79a8d4a Compare October 8, 2026 18:25
@nicoddemus nicoddemus changed the title Revive the build: share one headless Chrome across the test session [ASIM-6255] Revive the build: share one headless Chrome across the test session Oct 8, 2026
Comment thread src/qmxgraph/_cherrypy_server.py Outdated
@nicoddemus
nicoddemus force-pushed the fb-ASIM-6255-qmxgraph-build branch from 79a8d4a to d0fc075 Compare October 8, 2026 19:37
@nicoddemus
nicoddemus marked this pull request as ready for review October 8, 2026 19:37
@nicoddemus
nicoddemus requested a review from BeneBr October 8, 2026 19:37
@nicoddemus
nicoddemus added this pull request to stack #302 October 8, 2026 19:56
Comment thread src/qmxgraph/api.py Outdated
Comment thread src/qmxgraph/api.py Outdated
Comment thread src/qmxgraph/_cherrypy_server.py Outdated
Comment thread src/qmxgraph/_cherrypy_server.py Outdated
Comment thread src/qmxgraph/_cherrypy_server.py Outdated
Comment thread src/qmxgraph/_cherrypy_server.py Outdated
nicoddemus and others added 9 commits October 9, 2026 13:25
The CI build has been timing out for months: about halfway through the
suite Chrome stops answering chromedriver, and every following test hangs
on browser startup, gets rerun and errors out. The same hang reproduces
locally on Windows, and the test that triggers it passes in isolation.

Drop pytest-selenium, which launched a new Chrome and chromedriver for
every test, in favor of a single session-wide browser, and stop forcing a
1-second page load timeout with refresh retries. Locally the suite went
from a hang (or ~12 minutes with a dozen reruns) to about a minute with no
reruns.

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

test_set_scale_and_translation crashed on Selenium 4, which dropped the
legacy non-W3C actions, and was marked xfail on Linux because its expected
translation differed from Windows.

Port its right-button drag to W3C actions, starting from the container's
center since zooming pushes the vertex off-screen, where Selenium 4 refuses
to move the pointer. The platform difference came from the headless
viewport: the same window size yields a different viewport width on each
platform, and zooming centers on the container, shifting x. Fix the
viewport through the DevTools protocol, re-baseline the expected
translation and drop the xfail. The scale is deterministic, so also
compare it precisely instead of with a tolerance that accepted almost any
value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under QtWebEngine 5.15.15 JS errors reach Python as a bare "Script
error.", without message, location or stack, to be handled in ASIM-6921.

The xfail is strict, so the test fails once that is fixed and the marker
gets removed along with the fix instead of being left behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The conda-devenv based install broke on the GitHub runners: the base conda
there no longer recognizes the `devenv` subcommand, so the build failed
before running any test.

Give the project its own pixi environment, generated by pixi-devenv from
conda-forge, with the test dependencies in a `test` feature so they don't
leak into downstream environments. Tests now run on Python 3.12 instead of
3.10. The mxgraph package is dropped from the dependencies, as it only
exists on a private channel and the tests clone mxgraph from GitHub
anyway; downstream environments that need it must now declare it
themselves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With CI on pixi, the conda-devenv environment files were left unused and
the docs still taught a setup that no longer works.

Drop the conda-devenv files and rewrite the installation and examples
instructions around `pixi run`. The `docs` task now builds in a dedicated
pixi environment, whose dependencies are also listed in the requirements
file Read the Docs installs, so both note the coupling. Building under
`-W` needed a couple of docs warnings fixed; the two API handler
registrations involved are annotated along the way, and no longer return
the always-empty JS result.

Declare typing_extensions as a main dependency along the way: oop-ext
imports it but its conda-forge package doesn't declare it, so environments
only got it by accident through unrelated dependencies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests using the graph cases were automatically rerun up to three times on
CI to cope with the browser flakiness of launching one Chrome per test.
With a single shared browser that flakiness is gone, and a rerun can no
longer recover a broken browser anyway, so reruns would only hide real
intermittent failures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Python 3.14, the tests that host their own graph page fail on Linux
with "No child processes": the default multiprocessing start method there
became forkserver, so the server process is no longer a direct child and
waiting on its pid fails. Fix it ahead of testing on 3.14.

Stop the server through the multiprocessing process object instead, which
works with any start method and on Windows alike, and annotate the class.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
qmxgraph declared Python 3.10 as its minimum, but only 3.12 was tested,
and the docs environment resolved a different Python than the tests.

Raise the minimum to 3.12 and run CI on 3.12, 3.13 and 3.14, each a pixi
environment combining the test feature with a feature that only pins the
Python version. The docs environment shares the 3.12 solve group with the
default one, so both resolve the same package versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Building the resources and running the tests both need MXGRAPHPATH, which
developers and CI had to export by hand, in a bash-only way. With mxgraph
no longer a dependency, the fallback to the environment's mxgraph package
can't work in qmxgraph's own environments either.

Point it at the mxgraph clone in the repository from the test feature, so
it applies to every test environment on any platform without leaking into
downstream projects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nicoddemus
nicoddemus force-pushed the fb-ASIM-6255-qmxgraph-build branch from 5d7a8b2 to d2f0b3c Compare October 9, 2026 16:27
@nicoddemus
nicoddemus merged commit 366dd66 into master Oct 9, 2026
5 checks passed
@nicoddemus
nicoddemus deleted the fb-ASIM-6255-qmxgraph-build branch October 9, 2026 16:43
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