Skip to content

test_docker: align container launch with playwright-browsers#1919

Merged
yury-s merged 2 commits intomicrosoft:mainfrom
yury-s:unify-docker-with-pwbrowsers
May 8, 2026
Merged

test_docker: align container launch with playwright-browsers#1919
yury-s merged 2 commits intomicrosoft:mainfrom
yury-s:unify-docker-with-pwbrowsers

Conversation

@yury-s
Copy link
Copy Markdown
Member

@yury-s yury-s commented May 8, 2026

Summary

Aligns test_docker.yml with what microsoft/playwright-browsers' tests-docker.yml does, in two parts.

1. Container launch flags

Match upstream so the Java and Node test environments stay in sync.

  • run the container as pwuser (--user=pwuser --workdir /home/pwuser) instead of root
  • drop --ipc=host; set --shm-size=2g instead
  • explicit --platform linux/<arch> (arch is now a matrix dimension instead of an inline ternary)
  • deliver the repo via docker cp + chown rather than a bind mount
  • move the image-baked /root/.m2 into pwuser's home so the SNAPSHOT artifacts populated during the Docker build still resolve

2. Run only the @smoke subset

Mirrors the upstream Node setup: this Docker workflow is a Docker-compatibility check, not the full functional matrix. Five representative test classes are tagged @Tag("smoke") and surefire is invoked with -Dgroups=smoke, giving ~5 chromium launches per matrix run.

  • TestBrowser1, TestBrowserContextBasic, TestPageBasic, TestLocatorClick, TestSelectorsCss (~87 tests across 5 classes)
  • tools/test-local-installation/create_project_and_run_tests.sh forwards extra args to mvn, so the workflow can pass -Dgroups=smoke

Full functional coverage continues on the existing native test matrix outside this workflow.

Side benefit: eliminates the jammy SIGSEGV flake

Going from ~500 chromium launches per matrix run (full suite) to ~5 (smoke only) cuts the probabilistic chrome-headless-shell startup-SIGSEGV crashes — observed at roughly 0.2% per launch — from ~1.5 expected per run to <0.01. The underlying chromium bug remains and is still exposed by the full Java suite elsewhere, but this workflow should no longer flake on it.

Test plan

  • All four matrix entries pass: {jammy, noble} × {amd64, arm64}
  • The smoke step exercises the 5 tagged classes and Test ClassLoader runs the Spring Boot starter

@yury-s yury-s force-pushed the unify-docker-with-pwbrowsers branch from cc2c173 to d038c9e Compare May 8, 2026 18:08
@yury-s yury-s marked this pull request as ready for review May 8, 2026 18:08
@yury-s yury-s force-pushed the unify-docker-with-pwbrowsers branch 2 times, most recently from 3e97120 to 2b8392c Compare May 8, 2026 18:44
@yury-s yury-s merged commit 8f66ef1 into microsoft:main May 8, 2026
22 of 23 checks passed
yury-s added 2 commits May 8, 2026 12:10
Mirrors the docker run flags used by microsoft/playwright-browsers'
tests-docker.yml so the Java and Node test environments stay in sync.

  - run as pwuser (--user=pwuser --workdir /home/pwuser) instead of root
  - explicit --platform linux/<arch>
  - drop --ipc=host; set --shm-size=2g instead
  - deliver the repo via docker cp + chown rather than a bind mount,
    and move the image-baked /root/.m2 into pwuser's home so the
    locally-installed SNAPSHOT artifacts resolve
  - paths /root/playwright -> /home/pwuser/playwright

This is expected to fix the probabilistic chrome-headless-shell
SIGSEGV crashes observed on jammy in CI.
Mirrors the microsoft/playwright tests-docker.yml setup: the Docker
workflow runs only the @smoke subset (Docker compatibility check),
leaving the full suite for the regular CI matrix on native runners.

Five representative test classes get a class-level @tag("smoke"),
giving ~5 chromium launches when surefire is invoked with
-Dgroups=smoke:

  - TestBrowser1            (7 tests)
  - TestBrowserContextBasic (22 tests)
  - TestPageBasic           (33 tests)
  - TestLocatorClick        (5 tests)
  - TestSelectorsCss        (20 tests)

create_project_and_run_tests.sh forwards extra args to mvn so callers
can pass -Dgroups=smoke. test_docker.yml runs only the smoke subset.
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