Skip to content

Tag convention for test targets to reserve more RAM #14601

Closed

Description

@alexeagle

From https://docs.bazel.build/versions/main/test-encyclopedia.html#other-resources

You can increase the reservation to a higher number of CPU cores by adding the tag "cpu:n" (where n is a positive number) to a test rule.

This allows a test target to ensure enough CPUs will be reserved for it to run, but there is no similar affordance for RAM. Instead there is only

https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes-tests

size | String "enormous", "large" "medium" or "small", default is "medium"; optional
...
Test sizes correspond to the following default timeouts and assumed peak local resource
usages:
...
Size | RAM (in MB) | CPU (in CPU cores) | Default timeout
small | 20 | 1 | short (1 minute)
medium | 100 | 1 | moderate (5 minutes)
large | 300 | 1 | long (15 minutes)
enormous | 800 | 1 | eternal (60 minutes)

That seems to show that users can never reserve more than 800MB for a test target.
As a result, Bazel will OOM when scheduling too many parallel local spawns for tests that need more than 800MB.

Activity

  1. added
    untriaged
    on Jan 20, 2022
  2. gregestren commented on Feb 1, 2022

    @gregestren
    Contributor

    FYI https://docs.bazel.build/versions/main/exec-groups.html#using-execution-groups-to-set-execution-properties.

    That's not a drop in replacement for this. It is a newer, more generic API intended to support broader resource needs.

    I'd think about that API for whoever wants to address this.

  3. brandjon commented on Feb 10, 2022

    @brandjon
    Member

    Since it sounds like this request is superseded by by exec_properties, I think we can close this FR.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: feature requestuntriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions