Testing: add subprocess resource limits (M-TESTING-05)

This commit is contained in:
faumaray committed 2026-12-04 02:03:24 +03:00
1 parent 80e6ed9afc
commit 404bf4ce2f
4 files changed
+71

No files matched your search

+8
View File
@@ -944,6 +944,14 @@ namespace Void::Testing
std::this_thread::sleep_for(std::chrono::seconds{5});
return 0;
}
if (config.selftest_child == "alloc") {
// Touch a large buffer so an RLIMIT_AS cap is exercised.
constexpr std::size_t kAllocBytes = 256ULL * 1024ULL * 1024ULL;
std::vector<char> big(kAllocBytes, 'x');
volatile char sink = big[kAllocBytes - 1];
(void)sink;
return 0;
}
if (config.selftest_child == "flood") {
const std::string out_chunk(131072, 'O');
const std::string err_chunk(131072, 'E');