Skip to content

Add memory allocation check to e2e-tests global setup - #4910

Open
dominickendrick wants to merge 2 commits into
mainfrom
dk/add-devcontainer-memory-allocation-check
Open

dominickendrick wants to merge 2 commits into
mainfrom
dk/add-devcontainer-memory-allocation-check

Conversation

@dominickendrick

@dominickendrick dominickendrick commented Sep 3, 2026

Copy link
Copy Markdown

What

Adds a fast-failing memory check at the start of the Playwright globalSetup for the e2e tests.

Before any Testcontainers are started, assertSufficientMemory() compares os.totalmem() against a required threshold (REQUIRED_MEMORY_GB = 30). If the Docker host/VM has less memory than required, it logs a clear message and calls process.exit(1), terminating the run immediately.

Why

The full local Grid stack (Elasticsearch, LocalStack, and the eight Grid services) needs a substantial amount of memory. When Docker is under-provisioned, the stack fails to start in confusing, hard-to-diagnose ways (timeouts, OOM-killed containers). This check surfaces the real problem up front with an actionable message: increase the memory allocated to Docker.

How

  • Uses Node's built-in os.totalmem() — cross-platform, no shell subprocess.
  • Runs as the first step in globalSetup, so it fails before spinning up any containers.
  • On failure prints the available vs required memory to stderr and exits non-zero.

Testing

  • Ran the e2e setup locally on a machine with sufficient memory: check passes and prints the OK: ... line.
Screenshot 2026-09-03 at 12 26 02

Observed Error when allocation is not enough

Screenshot 2026-09-03 at 12 26 49
  • Verified TypeScript compiles with no errors.

@dominickendrick
dominickendrick requested a review from a team as a code owner September 3, 2026 11:31
@dominickendrick dominickendrick added the feature Departmental tracking: work on a new feature label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant