Fail HA benchmark on non-zero exit status
Summary: For HA benchmarks, if one of the executables exits with a status other than zero, the benchmark should fail. Also, removing `LOG(INFO)`, since failing benchmarks should flag where to look. Reviewers: ipaljak Reviewed By: ipaljak Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1921
This commit is contained in:
parent
f97872170a
commit
d387bac544
@ -55,9 +55,6 @@ class ReplicationTimeoutMap final {
|
||||
// time out.
|
||||
if (found == timeout_.end()) return false;
|
||||
if (found->second < Clock::now()) {
|
||||
LOG(INFO) << "Timeout happened for " << tx_id << " "
|
||||
<< std::chrono::system_clock::to_time_t(Clock::now()) << " "
|
||||
<< std::chrono::system_clock::to_time_t(found->second);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -34,6 +34,7 @@ DURATION=10
|
||||
|
||||
# Startup
|
||||
declare -a HA_PIDS
|
||||
declare -a exit_codes
|
||||
|
||||
for server_id in 1 2 3
|
||||
do
|
||||
@ -58,7 +59,7 @@ $binary_dir/tests/feature_benchmark/ha/read/benchmark \
|
||||
pid=$!
|
||||
|
||||
wait -n $pid
|
||||
code=$?
|
||||
exit_codes[0]=$?
|
||||
|
||||
# Shutdown
|
||||
for server_id in 1 2 3
|
||||
@ -70,14 +71,29 @@ done
|
||||
for server_id in 1 2 3
|
||||
do
|
||||
wait -n ${HA_PIDS[$server_id]}
|
||||
exit_codes[$server_id]=$?
|
||||
rm -r dur$server_id
|
||||
done
|
||||
|
||||
if [ $code -eq 0 ]; then
|
||||
failure=0
|
||||
|
||||
for i in `seq 0 3`; do
|
||||
code=${exit_codes[$i]}
|
||||
if [ $code -ne 0 ]; then
|
||||
if [ $i -eq 0 ]; then
|
||||
echo_failure "Benchmark exited with status $code"
|
||||
else
|
||||
echo_failure "Memgraph HA server $i exited with status $code"
|
||||
fi
|
||||
|
||||
failure=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $failure -eq 0 ]; then
|
||||
echo_success "Benchmark finished successfully"
|
||||
else
|
||||
echo_failure "Benchmark didn't finish successfully"
|
||||
exit $code
|
||||
fi
|
||||
|
||||
exit 0
|
||||
exit $failure
|
||||
|
@ -34,6 +34,7 @@ DURATION=10
|
||||
|
||||
# Startup
|
||||
declare -a HA_PIDS
|
||||
declare -a exit_codes
|
||||
|
||||
for server_id in 1 2 3
|
||||
do
|
||||
@ -58,7 +59,7 @@ $binary_dir/tests/feature_benchmark/ha/write/benchmark \
|
||||
pid=$!
|
||||
|
||||
wait -n $pid
|
||||
code=$?
|
||||
exit_codes[0]=$?
|
||||
|
||||
# Shutdown
|
||||
for server_id in 1 2 3
|
||||
@ -70,14 +71,29 @@ done
|
||||
for server_id in 1 2 3
|
||||
do
|
||||
wait -n ${HA_PIDS[$server_id]}
|
||||
exit_codes[$server_id]=$?
|
||||
rm -r dur$server_id
|
||||
done
|
||||
|
||||
if [ $code -eq 0 ]; then
|
||||
failure=0
|
||||
|
||||
for i in `seq 0 3`; do
|
||||
code=${exit_codes[$i]}
|
||||
if [ $code -ne 0 ]; then
|
||||
if [ $i -eq 0 ]; then
|
||||
echo_failure "Benchmark exited with status $code"
|
||||
else
|
||||
echo_failure "Memgraph HA server $i exited with status $code"
|
||||
fi
|
||||
|
||||
failure=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $failure -eq 0 ]; then
|
||||
echo_success "Benchmark finished successfully"
|
||||
else
|
||||
echo_failure "Benchmark didn't finish successfully"
|
||||
exit $code
|
||||
fi
|
||||
|
||||
exit 0
|
||||
exit $failure
|
||||
|
Loading…
Reference in New Issue
Block a user