Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Add slot rate check to automation framework #8676

Merged
merged 1 commit into from
Mar 6, 2020
Merged
Changes from all 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
21 changes: 20 additions & 1 deletion system-test/testnet-automation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ function wait_for_bootstrap_validator_stake_drop {
done
}

function get_slot {
source net/common.sh
loadConfigFile
ssh "${sshOptions[@]}" "${validatorIpList[0]}" '$HOME/.cargo/bin/solana slot'
}

function cleanup_testnet {
RC=$?
if [[ $RC != 0 ]]; then
Expand Down Expand Up @@ -197,6 +203,10 @@ function launchTestnet() {
--gpu-mode $startGpuMode --client-delay-start $CLIENT_DELAY_START
fi

START_SLOT=$(get_slot)
SLOT_COUNT_START_SECONDS=$SECONDS
execution_step "Slot: $START_SLOT, Seconds: $SLOT_COUNT_START_SECONDS"

execution_step "Waiting for bootstrap validator's stake percentage to fall below $BOOTSTRAP_VALIDATOR_MAX_STAKE_THRESHOLD %"
wait_for_bootstrap_validator_stake_drop "$BOOTSTRAP_VALIDATOR_MAX_STAKE_THRESHOLD"

Expand All @@ -223,7 +233,14 @@ function launchTestnet() {
# We should never get here
echo Test duration and partition config not defined
fi


END_SLOT=$(get_slot)
SLOT_COUNT_END_SECONDS=$SECONDS
execution_step "Slot: $END_SLOT, Seconds: $SLOT_COUNT_END_SECONDS"

SLOTS_PER_SECOND="$(bc <<< "scale=3; ($END_SLOT - $START_SLOT)/($SLOT_COUNT_END_SECONDS - $SLOT_COUNT_START_SECONDS)")"
execution_step "Average slot rate: $SLOTS_PER_SECOND slots/second over $((SLOT_COUNT_END_SECONDS - SLOT_COUNT_START_SECONDS)) seconds"

execution_step "Collect statistics about run"
declare q_mean_tps='
SELECT ROUND(MEAN("median_sum")) as "mean_tps" FROM (
Expand Down Expand Up @@ -278,6 +295,8 @@ function launchTestnet() {
--data-urlencode "q=$q_mean_tps;$q_max_tps;$q_mean_confirmation;$q_max_confirmation;$q_99th_confirmation;$q_max_tower_distance_observed;$q_last_tower_distance_observed" |
python system-test/testnet-automation-json-parser.py >>"$RESULT_FILE"

echo "slots_per_second: $SLOTS_PER_SECOND" >>"$RESULT_FILE"

execution_step "Writing test results to ${RESULT_FILE}"
RESULT_DETAILS=$(<"$RESULT_FILE")
upload-ci-artifact "$RESULT_FILE"
Expand Down