From e0e726d4a42658c8295877cc1b4c11b4ec073096 Mon Sep 17 00:00:00 2001 From: "Cel A. Skeggs" Date: Wed, 17 Feb 2021 16:52:03 -0500 Subject: [PATCH] update --- src/main/test-mr-many.sh | 10 +++++++--- src/main/test-mr.sh | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/test-mr-many.sh b/src/main/test-mr-many.sh index ba12406..c31155d 100644 --- a/src/main/test-mr-many.sh +++ b/src/main/test-mr-many.sh @@ -1,17 +1,21 @@ -#!/bin/bash +#!/usr/bin/env bash if [ $# -ne 1 ]; then echo "Usage: $0 numTrials" exit 1 fi +trap 'kill -INT -$pid; exit 1' INT + # Note: because the socketID is based on the current userID, # ./test-mr.sh cannot be run in parallel runs=$1 chmod +x test-mr.sh + for i in $(seq 1 $runs); do - if ! timeout -k 2s 900s ./test-mr.sh - then + timeout -k 2s 900s ./test-mr.sh & + pid=$! + if ! wait $pid; then echo '***' FAILED TESTS IN TRIAL $i exit 1 fi diff --git a/src/main/test-mr.sh b/src/main/test-mr.sh index b2ba432..1bf8bdf 100644 --- a/src/main/test-mr.sh +++ b/src/main/test-mr.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # basic map-reduce test