mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
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.
This commit is contained in:
parent
e5ebdf9e41
commit
f049ae6d57
@ -609,6 +609,8 @@ pub fn build(b: *std.Build) !void {
|
|||||||
.optimize_modes = optimization_modes,
|
.optimize_modes = optimization_modes,
|
||||||
.test_filters = test_filters,
|
.test_filters = test_filters,
|
||||||
.test_target_filters = test_target_filters,
|
.test_target_filters = test_target_filters,
|
||||||
|
// Highest RSS observed in any test case was exactly 1465151488 on x86_64-linux CI.
|
||||||
|
.max_rss = 1758181785,
|
||||||
})) |test_libc_step| test_step.dependOn(test_libc_step);
|
})) |test_libc_step| test_step.dependOn(test_libc_step);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,7 @@ pub const Options = struct {
|
|||||||
optimize_modes: []const std.builtin.OptimizeMode,
|
optimize_modes: []const std.builtin.OptimizeMode,
|
||||||
test_filters: []const []const u8,
|
test_filters: []const []const u8,
|
||||||
test_target_filters: []const []const u8,
|
test_target_filters: []const []const u8,
|
||||||
|
max_rss: usize,
|
||||||
};
|
};
|
||||||
|
|
||||||
const TestCase = struct {
|
const TestCase = struct {
|
||||||
@ -100,6 +101,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {
|
|||||||
const exe = libc.b.addExecutable(.{
|
const exe = libc.b.addExecutable(.{
|
||||||
.name = test_case.name,
|
.name = test_case.name,
|
||||||
.root_module = mod,
|
.root_module = mod,
|
||||||
|
.max_rss = libc.options.max_rss,
|
||||||
});
|
});
|
||||||
|
|
||||||
const run = libc.b.addRunArtifact(exe);
|
const run = libc.b.addRunArtifact(exe);
|
||||||
@ -108,6 +110,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {
|
|||||||
run.expectStdErrEqual("");
|
run.expectStdErrEqual("");
|
||||||
run.expectStdOutEqual("");
|
run.expectStdOutEqual("");
|
||||||
run.expectExitCode(0);
|
run.expectExitCode(0);
|
||||||
|
run.step.max_rss = libc.options.max_rss;
|
||||||
|
|
||||||
libc.root_step.dependOn(&run.step);
|
libc.root_step.dependOn(&run.step);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user