-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make load test retry if connection failed
- Loading branch information
1 parent
f9cb7bc
commit 2d9e8fd
Showing
3 changed files
with
99 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,19 @@ | ||
#!/bin/bash | ||
|
||
iterations=3 | ||
value=10000000 | ||
account=0x33c6b73432B3aeA0C1725E415CC40D04908B85fd | ||
end_val=$((172 * 1000 * 10000000)) | ||
end_val=$((172 * $iterations * $value)) | ||
|
||
#echo "Running ethrex..." | ||
#CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --bin ethrex --features dev -- --network test_data/genesis-l2.json --http.port 1729 & | ||
#echo "Sleeping 10s before running test..." | ||
#sleep 10 | ||
echo "Sending to account $account" | ||
ethrex_l2 test load --path ./test_data/private_keys.txt -i 1000 -v --value 10000000 --to $account | ||
ethrex_l2 test load --path ./test_data/private_keys.txt -i $iterations -v --value $value --to $account | ||
|
||
echo "Monitoring..." | ||
echo "Waiting for transactions to be processed..." | ||
output=$(cast balance $account --rpc-url=http://localhost:1729 2>&1) | ||
echo "ini $output" | ||
echo "end $end_val" | ||
while [[ $output -le $end_val ]]; do | ||
sleep 5 | ||
output=$(cast balance $account --rpc-url=http://localhost:1729 2>&1) | ||
echo "out $output" | ||
done | ||
echo "Balance of $output reached, killing process ethrex" | ||
|
||
sudo pkill ethrex && while pgrep -l cargo flamegraph; do sleep 1;done; | ||
echo "Done. Balance of $output reached, killing process ethrex" | ||
sudo pkill ethrex && while pgrep -l "cargo-flamegraph"; do sleep 1;done; | ||
echo "ethrex killed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters