Skip to content

Commit

Permalink
Stop dstat at the end of a job
Browse files Browse the repository at this point in the history
We should stop the dstat process that was previously started in
toci_gate_test.sh, so that processes aren't left running from tripleo-ci
jobs.

Change-Id: I200fe5f99d371fdde3b20518ffd10197680d46dd
  • Loading branch information
slagle committed Mar 30, 2017
1 parent 1ef798b commit 096b6ab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions scripts/common_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -432,3 +432,7 @@ function can_promote {
return 1
fi
}

function stop_dstat {
ps axjf | grep bin/dstat | grep -v grep | awk '{print $2;}' | sudo xargs -t -n 1 -r kill
}
2 changes: 1 addition & 1 deletion toci_instack_osinfra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ sudo yum -y install python-requests
# Open up port for delorean yum repo server
sudo iptables -I INPUT -p tcp --dport 8766 -j ACCEPT

trap "exit_val=\$?; [ \$exit_val != 0 ] && echo ERROR DURING PREVIOUS COMMAND ^^^ && echo 'See postci.txt in the logs directory for debugging details'; postci \$exit_val 2>&1 | ts '%Y-%m-%d %H:%M:%S.000 |' > $WORKSPACE/logs/postci.log 2>&1" EXIT
trap "exit_val=\$?; [ \$exit_val != 0 ] && echo ERROR DURING PREVIOUS COMMAND ^^^ && echo 'See postci.txt in the logs directory for debugging details'; postci \$exit_val 2>&1 | ts '%Y-%m-%d %H:%M:%S.000 |' > $WORKSPACE/logs/postci.log 2>&1; stop_dstat" EXIT

# Tempreverts/cherry-picks/pins go here. For example:
# temprevert tripleo-common af27127508eabf2b6873713e5e1507fa92b5f5b3 1623606
Expand Down
2 changes: 1 addition & 1 deletion toci_instack_ovb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ done
# Install some useful/necessary packages
sudo yum -y install wget python-simplejson yum-plugin-priorities qemu-img

trap "exit_val=\$?; [ \$exit_val != 0 ] && echo ERROR DURING PREVIOUS COMMAND ^^^ && echo 'See postci.txt in the logs directory for debugging details'; postci \$exit_val 2>&1 | ts '%Y-%m-%d %H:%M:%S.000 |' > $WORKSPACE/logs/postci.log 2>&1" EXIT
trap "exit_val=\$?; [ \$exit_val != 0 ] && echo ERROR DURING PREVIOUS COMMAND ^^^ && echo 'See postci.txt in the logs directory for debugging details'; postci \$exit_val 2>&1 | ts '%Y-%m-%d %H:%M:%S.000 |' > $WORKSPACE/logs/postci.log 2>&1; stop_dstat" EXIT

# Tempreverts/cherry-picks/pins go here. For example:
# temprevert tripleo-common af27127508eabf2b6873713e5e1507fa92b5f5b3 1623606
Expand Down

0 comments on commit 096b6ab

Please sign in to comment.