forked from lix-project/hydra
fix(t/evaluator/evaluate-oom): convert systemd-run presence check to eval, fix indentaion, show relationships between flags and commands with indentation
This commit is contained in:
parent
01ec004108
commit
e917d9e546
1 changed files with 30 additions and 19 deletions
|
@ -4,30 +4,41 @@ use Setup;
|
||||||
use Test2::V0;
|
use Test2::V0;
|
||||||
use Hydra::Helper::Exec;
|
use Hydra::Helper::Exec;
|
||||||
|
|
||||||
my ($systemdrRes) = captureStdoutStderr(3, (
|
eval {
|
||||||
"systemd-run", "--user", "--collect", "--scope", "--property", "MemoryMax=25M", "--",
|
captureStdoutStderr(3, (
|
||||||
"true"
|
"systemd-run",
|
||||||
|
"--user",
|
||||||
|
"--collect",
|
||||||
|
"--scope",
|
||||||
|
"--property",
|
||||||
|
"MemoryMax=25M",
|
||||||
|
"--",
|
||||||
|
"true"
|
||||||
|
));
|
||||||
|
} or do {
|
||||||
|
skip_all("systemd-run does not work in this environment");
|
||||||
|
};
|
||||||
|
|
||||||
|
my ($res, $stdout, $stderr) = captureStdoutStderr(60, (
|
||||||
|
"systemd-run",
|
||||||
|
"--user",
|
||||||
|
"--collect",
|
||||||
|
"--scope",
|
||||||
|
"--property",
|
||||||
|
"MemoryMax=25M",
|
||||||
|
"--",
|
||||||
|
"hydra-eval-jobs",
|
||||||
|
"-I", "/dev/zero",
|
||||||
|
"-I", "./t/jobs",
|
||||||
|
"./t/jobs/oom.nix"
|
||||||
));
|
));
|
||||||
|
|
||||||
skip_all("systemd-run does not work in this environment") if($systemdrRes != 0);
|
|
||||||
|
|
||||||
|
|
||||||
my ($res, $stdout, $stderr) = captureStdoutStderr(60,
|
|
||||||
(
|
|
||||||
"systemd-run", "--user", "--collect", "--scope", "--property", "MemoryMax=25M", "--",
|
|
||||||
"hydra-eval-jobs",
|
|
||||||
"-I", "/dev/zero",
|
|
||||||
"-I", "./t/jobs",
|
|
||||||
"./t/jobs/oom.nix"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
isnt($res, 0, "hydra-eval-jobs exits non-zero");
|
isnt($res, 0, "hydra-eval-jobs exits non-zero");
|
||||||
ok(utf8::decode($stderr), "Stderr output is UTF8-clean");
|
ok(utf8::decode($stderr), "Stderr output is UTF8-clean");
|
||||||
like(
|
like(
|
||||||
$stderr,
|
$stderr,
|
||||||
qr/^child process \(\d+?\) killed by signal=9$/m,
|
qr/^child process \(\d+?\) killed by signal=9$/m,
|
||||||
"The stderr record includes a relevant error message"
|
"The stderr record includes a relevant error message"
|
||||||
);
|
);
|
||||||
|
|
||||||
done_testing;
|
done_testing;
|
||||||
|
|
Loading…
Reference in a new issue