RunCommandLogs: add helpers for if it is running/failed/signaled
[?]
Nov 19, 2021, 6:21 PM
52IH5FN37NTRYXWISGUIT2CVJ52YBUSNRDPXMS3IIS3JOODQ523QCDependencies
- [2]
RZBW3YWDRunCommandLogs: add a did_succeed helper - [3]
FFJI7K6ERunCommandLogs: test recording a signaled process without a core dump - [4]
VYS5RV7YRunCommand: create run logs for each execution - [*]
2GNJU4VFRunCommandLogs: init table
Change contents
- edit in src/lib/Hydra/Schema/Result/RunCommandLogs.pm at line 259
=head2 is_running - edit in src/lib/Hydra/Schema/Result/RunCommandLogs.pm at line 263[2.386][6.2945]
Looks in the database to see if the task has been marked as completed.Does not actually examine to see if the process is running anywhere.Return:* true if the task does not have a marked end date* false if the task does have a recorded end=cutsub is_running {my ($self) = @_;return !defined($self->end_time);}=head2 did_fail_with_signalLooks in the database to see if the task failed with a signal.Return:* true if the task is not running and failed with a signal.* false if the task is running or exited with an exit code.=cutsub did_fail_with_signal {my ($self) = @_;if ($self->is_running()) {return 0;}if ($self->did_succeed()) {return 0;}return defined($self->signal);} - edit in t/Schema/Result/RunCommandLogs.t at line 57
ok($runlog->is_running(), "The process is running.");ok(!$runlog->did_fail_with_signal(), "The process was not killed by a signal."); - edit in t/Schema/Result/RunCommandLogs.t at line 71
ok(!$runlog->is_running(), "The process is not running.");ok(!$runlog->did_fail_with_signal(), "The process was not killed by a signal."); - edit in t/Schema/Result/RunCommandLogs.t at line 86
ok(!$runlog->is_running(), "The process is not running.");ok(!$runlog->did_fail_with_signal(), "The process was not killed by a signal."); - edit in t/Schema/Result/RunCommandLogs.t at line 101
ok(!$runlog->is_running(), "The process is not running.");ok($runlog->did_fail_with_signal(), "The process was killed by a signal."); - replacement in t/Schema/Result/RunCommandLogs.t at line 108
is($runlog->core_dumped, 1, "There was no core dump.");is($runlog->core_dumped, 0, "There was no core dump."); - edit in t/Schema/Result/RunCommandLogs.t at line 116
ok(!$runlog->is_running(), "The process is not running.");ok($runlog->did_fail_with_signal(), "The process was killed by a signal."); - edit in t/Schema/Result/RunCommandLogs.t at line 131
ok(!$runlog->is_running(), "The process is running.");ok(!$runlog->did_fail_with_signal(), "The process was not killed by a signal.");