authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-30 18:50:38+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-01 03:25:13+02:00
logf049ae6d57341b4abd64fb6e65b6f9a05af1c226
treeae351f9deaa6f39f5ce208ad920fa0875db7e08a
parente5ebdf9e4199abc347c72d0ff00e211e858a200c
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

libc-test: set a 1.6G max_rss for each test case

1.4G was the highest value I observed for any test case on x86_64-linux. This change should prevent OOM conditions in CI.

2 files changed, 5 insertions(+), 0 deletions(-)

build.zig+2
......@@ -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+3
......@@ -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
1516const 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 }