Fix flaky ha feature benchmark

Reviewers: msantl

Reviewed By: msantl

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1820
This commit is contained in:
Ivan Paljak 2019-01-21 11:10:32 +01:00
parent f9c63987c6
commit 276672c310
3 changed files with 25 additions and 14 deletions

View File

@ -9,13 +9,13 @@
- ../../../build_release/tests/feature_benchmark/kafka/benchmark # benchmark binary
enable_network: true
#- name: feature_benchmark__ha
# cd: ha
# commands: ./runner.sh
# infiles:
# - runner.sh # runner script
# - raft.json # raft configuration file
# - coordination.json # coordination configuration file
# - ../../../build_release/tests/feature_benchmark/ha/benchmark # benchmark binary
# - ../../../build_release/memgraph_ha # memgraph binary
# enable_network: true
- name: feature_benchmark__ha
cd: ha
commands: ./runner.sh
infiles:
- runner.sh # runner script
- raft.json # raft configuration file
- coordination.json # coordination configuration file
- ../../../build_release/tests/feature_benchmark/ha/benchmark # benchmark binary
- ../../../build_release/memgraph_ha # memgraph binary
enable_network: true

View File

@ -1,6 +1,6 @@
{
"election_timeout_min": 100,
"election_timeout_max": 300,
"heartbeat_interval": 50,
"election_timeout_min": 350,
"election_timeout_max": 700,
"heartbeat_interval": 100,
"replicate_timeout": 100
}

View File

@ -1,5 +1,15 @@
#!/bin/bash
## Helper functions
function wait_for_server {
port=$1
while ! nc -z -w 1 127.0.0.1 $port; do
sleep 0.1
done
sleep 1
}
function echo_info { printf "\033[1;36m~~ $1 ~~\033[0m\n"; }
function echo_success { printf "\033[1;32m~~ $1 ~~\033[0m\n\n"; }
function echo_failure { printf "\033[1;31m~~ $1 ~~\033[0m\n\n"; }
@ -33,10 +43,11 @@ do
--port $((7686 + $server_id)) \
--durability_directory=dur$server_id &
HA_PIDS[$server_id]=$!
wait_for_server $((7686 + $server_id))
done
# Allow some time for leader election.
sleep 3
sleep 10
# Start the memgraph process and wait for it to start.
echo_info "Starting HA benchmark"