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 0ce9a44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 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_client/src/file_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ impl Files {
let missing_chunks: Vec<XorName> = chunks_info
.iter()
.filter_map(|expected_info| {
if !retrieved_chunks.iter().any(|retrieved_chunk| {
if retrieved_chunks.iter().any(|retrieved_chunk| {
XorName::from_content(&retrieved_chunk.content) == expected_info.dst_hash
}) {
None
Expand Down

0 comments on commit 0ce9a44

Please sign in to comment.