Skip to content

Commit

Permalink
test: more replication flow statistics during mem_check test
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi committed Jun 7, 2023
1 parent 0be2ef0 commit 61759ca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/memcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,16 @@ jobs:
# then check we have an expected level of replication
# TODO: make this use an env var, or relate to testnet size
run : |
replication_count=$(rg "Chunk received for replication" ~/.safe/node/local-test-network -c --stats | rg "(\d+) matches" | rg "\d+" -o)
echo "Replicated $replication_count copies"
sending_list_count=$(rg "Sending a replication list" ~/.safe/node/local-test-network -c --stats | rg "(\d+) matches" | rg "\d+" -o)
echo "Sent $sending_list_count replication lists"
received_list_count=$(rg "Replicate list received from" ~/.safe/node/local-test-network -c --stats | rg "(\d+) matches" | rg "\d+" -o)
echo "Received $received_list_count replication lists"
fetching_attempt_count=$(rg "Fetching replication" ~/.safe/node/local-test-network -c --stats | rg "(\d+) matches" | rg "\d+" -o)
echo "Carried out $fetching_attempt_count fetching attempts"
replication_attempt_count=$(rg "Replicating chunk" ~/.safe/node/local-test-network -c --stats | rg "(\d+) matches" | rg "\d+" -o)
echo "Carried out $replication_attempt_count attempts"
echo "Sent $replication_attempt_count chunk copies"
replication_count=$(rg "Chunk received for replication" ~/.safe/node/local-test-network -c --stats | rg "(\d+) matches" | rg "\d+" -o)
echo "Received $replication_count chunk copies"
node_count=$(ls $log_dir | wc -l)
if [ $replication_count -lt $node_count ]; then
echo "Replication count of: $replication_count is less than the node count of: $node_count"
Expand Down
2 changes: 1 addition & 1 deletion sn_networking/src/replication_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::{
};

// Max parallel fetches can be undertaken at the same time.
const MAX_PARALLEL_FETCH: usize = 8;
const MAX_PARALLEL_FETCH: usize = 4;

// The duration after which a peer will be considered failed to fetch data from,
// if no response got from that peer.
Expand Down
2 changes: 1 addition & 1 deletion sn_node/tests/data_with_churn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const CHURN_CYCLES: u32 = 1;
const CHUNK_CREATION_RATIO_TO_CHURN: u32 = 5;
const REGISTER_CREATION_RATIO_TO_CHURN: u32 = 5;

const CHUNKS_SIZE: usize = 1000 * 500;
const CHUNKS_SIZE: usize = 1024 * 1024;

const CONTENT_QUERY_RATIO_TO_CHURN: u32 = 12;
const MAX_NUM_OF_QUERY_ATTEMPTS: u8 = 5;
Expand Down

0 comments on commit 61759ca

Please sign in to comment.