Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .ci/devnet_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ total_validators=$1
total_clients=$2
network_id=$3
min_height=$4
max_warnings=$5

# The verobsity of snarkos nodes.
NODE_VERBOSITY=3
Expand All @@ -23,6 +24,7 @@ NODE_VERBOSITY=3
: "${total_clients:=4}" # need at least 4 clients, so each validator has at least one client connected to it.
: "${network_id:=0}"
: "${min_height:=60}" # To likely go past the 100 round garbage collection limit.
: "${max_warnings:=10}"

# shellcheck source=SCRIPTDIR/utils.sh
. ./.ci/utils.sh
Expand Down Expand Up @@ -395,7 +397,7 @@ while (( total_wait < 600 )); do # 10 minutes max
if check_heights 0 $((total_validators+total_clients)) "$min_height" "$network_name" "$total_wait"; then
echo "🎉 Test passed! All nodes reached minimum height."

if check_logs "$log_dir" "$total_validators" "$total_clients"; then
if check_logs "$log_dir" "$total_validators" "$total_clients" "$max_warnings"; then
exit 0
else
exit 1
Expand Down
21 changes: 18 additions & 3 deletions .ci/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,15 @@ function check_heights() {

# Function checking that nodes created logs on disk and they contain no errors.
function check_logs() {
echo "Checking logs exist for all nodes..."
echo "Checking logs exist for all nodes and contain no errors..."
local log_dir=$1
local total_validators=$2
local total_clients=$3

# The maximum number of warnings allow in each node's log file.
# Nodes may create some warnings at startup because they cannot connect to each other yet.
local max_warnings=$4


local all_reached=true
local highest_height=0

Expand All @@ -102,6 +106,12 @@ function check_logs() {
grep "ERROR" "$log_dir/validator-${validator_index}.log"
return 1
fi

num_warnings=$(grep -c "WARN" "$log_dir/validator-${validator_index}.log")
if (( num_warnings > max_warnings )); then
echo "❌ Test failed! Validator #${validator_index} logs contain more than ${max_warnings} warnings."
return 1
fi
done

for ((client_index = 0; client_index < total_clients; client_index++)); do
Expand All @@ -116,7 +126,12 @@ function check_logs() {
grep "ERROR" "$log_dir/client-${client_index}.log"
return 1
fi


num_warnings=$(grep -c "WARN" "$log_dir/client-${client_index}.log")
if (( num_warnings > max_warnings )); then
echo "❌ Test failed! Client #${client_index} logs contain more than ${max_warnings} warnings."
return 1
fi
done

return 0
Expand Down
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ commands:
- run:
name: "Install snarkos"
no_output_timeout: 20m
environment:
CONSENSUS_VERSION_HEIGHTS: "0,100"
EXPECTED_MAX_CONSENSUS_VERSION: "10"
WAIT_BETWEEN_UPGRADES: "60"
command: |
cargo install --locked --path . --features test_network
- run:
Expand Down
Loading