Skip to content

Speed up CI by running the test suite in parallel #10615

Description

@dblythy

New Feature / Enhancement Checklist

Current Limitation

Every PR runs the full jasmine suite (135 spec files, ~3,500 tests) serially in a single Node process, 8 times over (5 MongoDB variants + 3 Postgres variants in ci.yml). Each job takes up to 20 minutes while the runner's 4 vCPUs sit mostly idle, so PR feedback time is bounded by a slow serial run repeated per environment.

Feature / Enhancement Description

Jasmine 5 supports parallel execution via worker processes (--parallel=N). Workers are separate Node processes, so all in-process state (the booted Parse Server, Cloud Code hooks, the Parse global) is naturally isolated per worker, and jasmine hands spec files to idle workers dynamically, which self-balances load. The suite already passes with random: true, which is the main precondition for parallel mode.

The shared resources are the only real collisions, and they're bounded:

  • spec/helper.js hardcodes port 8378 and one database; each worker instead picks a free port and a per-worker database name (parse_test_<pid>) on the same mongod/postgres instance
  • 48 spec files hardcode http://localhost:8378/1 and should use the helper's exported serverURL; mock servers on fixed ports move to listen(0)
  • top-level beforeAll/afterAll in spec/helper.js aren't supported in parallel mode and need converting
  • CurrentSpecReporter and the flaky retry patch track a single current spec and need to key by spec id instead
  • CI enables --parallel; serial stays the default locally so single-file debugging is unchanged

Expected result: roughly 3-4x faster test jobs with no increase in total CI minutes, since nothing about job setup is duplicated.

Example Use Case

n/a (CI / developer experience)

Alternatives / Workarounds

  • Shard spec files across more matrix jobs: cuts wall clock but duplicates npm ci / build / DB startup per shard, so total minutes go up
  • Run fewer environments per PR with the full matrix on push to alpha: complementary, worth its own issue
  • Implement Parallel Unit testing #9467 proposes a separate mocked unit test suite; this issue parallelises the existing e2e suite without changing the testing approach

3rd Party References

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:ciCI related issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions