#! /bin/bash
# @file        timeout-simple-hang.bash
#              Test to ensure that Peter will kill .simple tests when they are hung. See DCP-3175.
# @author      Kirill Kirnichansky, kirill@distributive.network
# @author      Wes Garland, wes@distributive.network
# @date        July 2023
#
# peter-timeout: 5

$PETER --timeout=2 ../../tests-libexec/hanging-test.simple 2>&1
$PETER --timeout=2 ../../tests-libexec/handing-test.tap 2>&1

if [ "$?" = "0" ]; then
  exit 1
else
  # We are expecting a "failure" of hanging-test.simple due to timeout expiring when this test passes
  exit 0
fi
