Skip to content

Warm Playwright cache on develop and bump workers to 10#456

Merged
nitrobass24 merged 7 commits into
developfrom
ci/cache-warm-and-bump-workers
May 2, 2026
Merged

Warm Playwright cache on develop and bump workers to 10#456
nitrobass24 merged 7 commits into
developfrom
ci/cache-warm-and-bump-workers

Conversation

@nitrobass24
Copy link
Copy Markdown
Owner

@nitrobass24 nitrobass24 commented May 2, 2026

Summary

  • Drop the develop-push skip on Build and Test (amd64) so it actually runs on merges to develop
  • Set workers: 5 in playwright.config.ts (was defaulting to ~2 on the 4-vCPU runner)

Why — cache warming

The current if: skips Build and Test on push to develop. Combined with actions/cache@v4's default branch-scoped storage, this means develop never has a populated Playwright browser cache:

  1. PR runs → cache miss (no parent cache exists) → installs browsers + system deps → tests pass → cache saves under the PR branch's scope only
  2. PR merges → develop push skips Build and Test → develop's cache stays empty
  3. Next PR opens → looks for cache on its own branch (empty, fresh PR) and on develop (empty) → cache miss, full install again

GitHub Actions caches inherit from the parent branch, not from sibling PRs. So as long as develop never populates, every fresh PR pays the install cost (~2 min for browsers + ~1 min apt deps when the network cooperates, or 11+ minutes when an Ubuntu mirror flakes).

Letting the job run once on each develop push gives every subsequent PR a cache hit. With cache warm the job runs in ~2-3 min total — a small price for shared cache benefit.

Why — workers

With fullyParallel: false and no explicit workers setting, Playwright defaults to roughly half the available CPUs in CI — 2 on a 4-vCPU runner. Bumping to 5 lets up to 5 spec files run in parallel. Within each file tests still run serially (since fullyParallel: false is preserved).

Risks / things to watch

  • Multiple workers hit the same shared Docker container, so spec files that mutate global config (settings, path-pairs, integrations) can race against each other. If we see new flakes after this lands, the answer is either to drop workers back to 3, or to add per-file isolation (separate containers, or a fixture that snapshots/restores config).
  • The first develop push after this merges will be a slower run (~10 min, full cold install). Subsequent PRs will see cache hits.

Test plan

  • CI on this PR's first run is a cache miss (no develop cache yet) — completes successfully and saves the PR-branch cache
  • After merge, the develop push runs Build and Test (amd64) and saves the develop-scoped cache
  • The next PR after that shows Cache hit for ... on the Cache Playwright browsers step and skips browser install
  • Run E2E tests reports up to 5 workers active (visible in the test list output)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated CI workflow to run build tests when pushing to the develop branch.
    • Enabled parallel test execution with 10 concurrent workers for improved test performance.
    • Reorganized end-to-end test suite for enhanced validation coverage.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 789e4988-68ec-405d-a939-85a7fc9da53b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR updates CI pipeline conditions to run tests on the develop branch, configures Playwright with 10 parallel workers for faster test execution, and reorganizes E2E tests by moving the "Server Directory disabled" assertion from settings to path-pairs spec and removing duplicate/redundant test cases.

Changes

CI Workflow Update

Layer / File(s) Summary
Job Run Condition
.github/workflows/ci.yml
The build-test job if: condition was updated to remove the develop branch exclusion, allowing tests to run on all develop branch pushes (excluding only version tag pushes and manual workflow dispatch events).

E2E Test Infrastructure and Reorganization

Layer / File(s) Summary
Test Configuration
src/e2e-playwright/playwright.config.ts
Added workers: 10 configuration to enable parallel test execution across 10 workers, improving test suite throughput.
Test Reorganization
src/e2e-playwright/tests/path-pairs.spec.ts, src/e2e-playwright/tests/settings.spec.ts
Moved "Server Directory disabled when path pairs exist" test from settings.spec.ts to path-pairs.spec.ts. Removed redundant settings tests for restart notification, Web GUI Port value display, and API Key masking. Settings spec now focuses on Advanced LFTP section validation (7 options count).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: removing the develop-branch skip condition to warm cache and increasing Playwright workers from 2 to 10.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/cache-warm-and-bump-workers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nitrobass24 nitrobass24 changed the title Warm Playwright cache on develop and bump workers to 5 Warm Playwright cache on develop and bump workers to 10 May 2, 2026
nitrobass24 and others added 3 commits May 2, 2026 12:26
Two CI throughput improvements rolled up.

1. Drop the develop-push skip on Build and Test (amd64). With it in place
   the job never ran on develop merges, so the actions/cache step never
   populated a develop-scoped Playwright browser cache. PRs targeting
   develop fall back to looking at their own branch (empty for fresh
   PRs) and at develop (also empty), and pay the full browser+system-deps
   install cost every run. Letting the job run on develop pushes warms
   the cache once per merge so subsequent PRs hit it.

2. Set workers: 5 in playwright.config.ts. Default on a 4-vCPU runner is
   ~2 workers, which the user observed as "two tests at a time". Bumping
   to 5 lets five spec files run in parallel. fullyParallel stays false,
   so within a file tests still run serially.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
settings.spec.ts:176 created and deleted a temporary path pair to
verify the Server Directory field becomes disabled. With workers > 2
that test ran in parallel with path-pairs.spec.ts, whose beforeEach
and afterEach delete every existing pair to start from a clean slate.
The result was a 404 on cleanup ("Failed to delete temp pair … 404")
and intermittently the assertion itself, depending on which spec's
hook fired first.

Move the test into path-pairs.spec.ts so it shares the same per-file
serialized cleanup. No other spec creates pairs from outside its own
describe block, which removes the cross-file pair race entirely.
integrations.spec.ts has the same nuclear-cleanup pattern but no other
spec creates integrations, so it isn't affected today — flagging it
as a pattern to watch as we add more cross-cutting tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nitrobass24 nitrobass24 force-pushed the ci/cache-warm-and-bump-workers branch from c9f5c35 to 99e5f49 Compare May 2, 2026 17:26
nitrobass24 and others added 2 commits May 2, 2026 12:29
ubuntu-latest has 4 vCPUs. With workers: 10 we ran 10 chromium
processes plus the SeedSync container on those 4 cores, ~2.5x CPU
oversubscription. The suite ran slower overall — context-switching
overhead and contention on the shared backend dominated any
parallelism gain. With fullyParallel: false the per-file serialization
also caps useful parallelism at the spec count, and the longest spec
(settings) sets the floor regardless of worker count.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Leave one of the runner's 4 vCPUs free for the SeedSync Docker
container and runner overhead instead of saturating all four with
chromium worker processes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

430-443: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

publish doesn't gate on build-test — E2E failures won't block a develop publish.

Now that build-test runs on develop pushes, a regression that breaks the E2E suite would still allow publish to proceed and push a develop-tagged image. Adding build-test to publish's needs and condition closes this gap. Using || needs.build-test.result == 'skipped' handles the tag-push and workflow_dispatch paths where build-test is intentionally skipped.

🛡️ Proposed addition to the publish job
   publish:
     name: Publish
     if: >-
       always() && !cancelled()
       && (startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/develop' && github.event_name == 'push') || github.event_name == 'workflow_dispatch')
       && needs.unit-test.result == 'success'
       && needs.angular-lint.result == 'success'
       && needs.python-lint.result == 'success'
       && needs.python-typecheck.result == 'success'
       && needs.python-test.result == 'success'
       && needs.python-integration-test.result == 'success'
+      && (needs.build-test.result == 'success' || needs.build-test.result == 'skipped')
       && needs.build-amd64.result == 'success'
       && needs.build-arm64.result == 'success'
-    needs: [unit-test, angular-lint, python-lint, python-typecheck, python-test, python-integration-test, build-amd64, build-arm64]
+    needs: [unit-test, angular-lint, python-lint, python-typecheck, python-test, python-integration-test, build-test, build-amd64, build-arm64]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 430 - 443, The publish job currently
does not depend on build-test so E2E/regression failures won’t block publishing
for develop; update the publish job (job name "publish") to include build-test
in its needs array and add a check for needs.build-test.result in the job's if
condition (allowing "skipped" via || needs.build-test.result == 'skipped' to
support tag pushes and workflow_dispatch), ensuring the publish job only
proceeds when build-test succeeds or is intentionally skipped.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 430-443: The publish job currently does not depend on build-test
so E2E/regression failures won’t block publishing for develop; update the
publish job (job name "publish") to include build-test in its needs array and
add a check for needs.build-test.result in the job's if condition (allowing
"skipped" via || needs.build-test.result == 'skipped' to support tag pushes and
workflow_dispatch), ensuring the publish job only proceeds when build-test
succeeds or is intentionally skipped.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0e8fb929-bf0d-497c-b433-60ff4b0d5e7a

📥 Commits

Reviewing files that changed from the base of the PR and between be50a36 and 99e5f49.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • src/e2e-playwright/playwright.config.ts
  • src/e2e-playwright/tests/path-pairs.spec.ts
  • src/e2e-playwright/tests/settings.spec.ts
💤 Files with no reviewable changes (1)
  • src/e2e-playwright/tests/settings.spec.ts

nitrobass24 and others added 2 commits May 2, 2026 12:36
Replace the host-installed Playwright pipeline with a single docker run
of mcr.microsoft.com/playwright:v<lockfile-version>-noble. That image
ships chromium plus all system deps prebaked, so we eliminate:

  - Set up Node.js (cache: npm)
  - Install Playwright dependencies (npm ci on host)
  - Cache Playwright browsers (actions/cache)
  - Install Playwright browsers (npx playwright install)
  - Install Playwright system deps (apt install fonts/xfonts)

The version pin is read from package-lock.json with jq so a future
@playwright/test bump auto-bumps the image tag — the chromium binary
in the image must match the @playwright/test API expectations.

Container-to-SUT networking uses --network host so localhost:8800
still resolves to the seedsync test-container started in the previous
step.

Also drop workers from 3 to 2: with the Playwright image now running
as another process group on the same 4-vCPU runner, the previous
"leave one core for runner overhead" math becomes "leave two cores
for runner + Playwright container coordination."

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Trying 4 (one per vCPU) now that the system-deps install is gone and
chromium runs inside the official Playwright image instead of on the
host. If we see contention or test races we can drop again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nitrobass24 nitrobass24 merged commit 142dc62 into develop May 2, 2026
18 checks passed
@nitrobass24 nitrobass24 deleted the ci/cache-warm-and-bump-workers branch May 2, 2026 17:45
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.

1 participant