RunCommandLogs: test recording a signaled process without a core dump

[?]
Nov 19, 2021, 5:29 PM
FFJI7K6EGJJO752IJPK5LAWZT4SA3P6JAEMKDR5VGYNCXEEKHQKAC

Dependencies

  • [2] VYS5RV7Y RunCommand: create run logs for each execution
  • [3] CBU7KGFE Record the errno if exec fails
  • [4] RZBW3YWD RunCommandLogs: add a did_succeed helper
  • [*] 2GNJU4VF RunCommandLogs: init table

Change contents

  • replacement in src/lib/Hydra/Schema/Result/RunCommandLogs.pm at line 219
    [2.2021][2.2021:2071]()
    $core_dumped = ($child_error & 128) == 128;
    [2.2021]
    [2.2071]
    #
    # The `+ 0` is handling another dualvar. It is a bool, but a
    # bool false is an empty string in boolean context and 0 in a
    # numeric concept. The ORM knows the column is a bool, but
    # does not treat the empty string as a bool when talking to
    # postgres.
    $core_dumped = (($child_error & 128) == 128) + 0;
  • edit in t/Schema/Result/RunCommandLogs.t at line 90
    [2.5382]
    [2.5382]
    subtest "The process completed (status 15, child error 0)" => sub {
    my $runlog = new_run_log();
    $runlog->started();
    $runlog->completed_with_child_error(15, 0);
    ok(!$runlog->did_succeed(), "The process did not succeed.");
    is($runlog->start_time, within(time() - 1, 2), "The start time is recent.");
    is($runlog->end_time, within(time() - 1, 2), "The end time is recent.");
    is($runlog->error_number, undef, "The error number is undefined");
    is($runlog->exit_code, undef, "The exit code is undefined.");
    is($runlog->signal, 15, "Signal 15 was sent.");
    is($runlog->core_dumped, 1, "There was no core dump.");
    };