Skip to content

Commit

Permalink
[libcxx] [test] Add a test parameter for disabling memory intensive t…
Browse files Browse the repository at this point in the history
…ests (#68214)

Specifically, the test std/input.output/string.streams/stringstream/stringstream.members/gcount.pass.cpp
allocates a std::string with INT_MAX-1 elements, and then writes this to
a std::stringstream. On Linux, running this test consumes around 5.0 GB
of memory; on Windows, it ends up using up to 6.8 GB of memory.

This limits whether such tests can run on e.g. GitHub Actions runners,
where the free runners are limited to 8 GB of memory.

This is somewhat similar to, but still notably different, from the
existing test parameter long_tests.

(cherry picked from commit 122064a)
  • Loading branch information
mstorsjo authored and tru committed Oct 24, 2023
1 parent 71f408b commit aa03fba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: 32-bit-pointer
// REQUIRES: large_tests

// Test that tellp() does not break the stringstream after INT_MAX, due to use
// of pbump() that accept int.
Expand Down
8 changes: 8 additions & 0 deletions libcxx/utils/libcxx/test/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,14 @@ def getModuleFlag(cfg, enable_modules):
help="Whether to enable tests that take longer to run. This can be useful when running on a very slow device.",
actions=lambda enabled: [] if not enabled else [AddFeature("long_tests")],
),
Parameter(
name="large_tests",
choices=[True, False],
type=bool,
default=True,
help="Whether to enable tests that use a lot of memory. This can be useful when running on a device with limited amounts of memory.",
actions=lambda enabled: [] if not enabled else [AddFeature("large_tests")],
),
Parameter(
name="enable_assertions",
choices=[True, False],
Expand Down

0 comments on commit aa03fba

Please sign in to comment.