Skip to content

Commit 7c4eb3e

Browse files
committed
test: set a 1.6G max_rss for test-libc test cases
1.4G was the highest value I observed for any test case on x86_64-linux. This change should prevent OOM conditions in CI.
1 parent 7adb158 commit 7c4eb3e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

build.zig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,8 @@ pub fn build(b: *std.Build) !void {
609609
.optimize_modes = optimization_modes,
610610
.test_filters = test_filters,
611611
.test_target_filters = test_target_filters,
612+
// Highest RSS observed in any test case was exactly 1465151488 on x86_64-linux CI.
613+
.max_rss = 1758181785,
612614
})) |test_libc_step| test_step.dependOn(test_libc_step);
613615
}
614616

test/src/Libc.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub const Options = struct {
1010
optimize_modes: []const std.builtin.OptimizeMode,
1111
test_filters: []const []const u8,
1212
test_target_filters: []const []const u8,
13+
max_rss: usize,
1314
};
1415

1516
const TestCase = struct {
@@ -100,6 +101,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {
100101
const exe = libc.b.addExecutable(.{
101102
.name = test_case.name,
102103
.root_module = mod,
104+
.max_rss = libc.options.max_rss,
103105
});
104106

105107
const run = libc.b.addRunArtifact(exe);
@@ -108,6 +110,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {
108110
run.expectStdErrEqual("");
109111
run.expectStdOutEqual("");
110112
run.expectExitCode(0);
113+
run.step.max_rss = libc.options.max_rss;
111114

112115
libc.root_step.dependOn(&run.step);
113116
}

0 commit comments

Comments
 (0)