Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: enable data_with_churn using networkspawner #2809

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
88 changes: 44 additions & 44 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@
node_data_path: /home/runner/.local/share/autonomi/node
ant_path: /home/runner/.local/share/autonomi
- os: windows-latest
node_data_path: C:\\Users\\runneradmin\\AppData\\Roaming\\autonomi\\node

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
ant_path: C:\\Users\\runneradmin\\AppData\\Roaming\\autonomi
- os: macos-latest
node_data_path: /Users/runner/Library/Application Support/autonomi/node
Expand All @@ -661,28 +661,40 @@
CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
timeout-minutes: 30

- name: Start a local network
uses: maidsafe/ant-local-testnet-action@main
with:
action: start
enable-evm-testnet: true
node-path: target/release/antnode
platform: ${{ matrix.os }}
build: true

- name: Check if ANT_PEERS and EVM_NETWORK are set
shell: bash
run: |
if [[ -z "$ANT_PEERS" ]]; then
echo "The ANT_PEERS variable has not been set"
exit 1
elif [[ -z "$EVM_NETWORK" ]]; then
echo "The EVM_NETWORK variable has not been set"
exit 1
else
echo "ANT_PEERS has been set to $ANT_PEERS"
echo "EVM_NETWORK has been set to $EVM_NETWORK"
fi
# - name: Start a local network
# uses: maidsafe/ant-local-testnet-action@main
# with:
# action: start
# enable-evm-testnet: true
# node-path: target/release/antnode
# platform: ${{ matrix.os }}
# build: true

# - name: Check if ANT_PEERS and EVM_NETWORK are set
# shell: bash
# run: |
# if [[ -z "$ANT_PEERS" ]]; then
# echo "The ANT_PEERS variable has not been set"
# exit 1
# elif [[ -z "$EVM_NETWORK" ]]; then
# echo "The EVM_NETWORK variable has not been set"
# exit 1
# else
# echo "ANT_PEERS has been set to $ANT_PEERS"
# echo "EVM_NETWORK has been set to $EVM_NETWORK"
# fi

# # Sleep for a while to allow restarted nodes can be detected by others
# - name: Sleep a while
# run: sleep 300

# - name: Stop the local network and upload logs
# if: always()
# uses: maidsafe/ant-local-testnet-action@main
# with:
# action: stop
# log_file_prefix: safe_test_logs_churn
# platform: ${{ matrix.os }}

- name: Chunks data integrity during nodes churn
run: cargo test --release -p ant-node --test data_with_churn -- --nocapture
Expand All @@ -693,35 +705,23 @@
CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
timeout-minutes: 30

# Sleep for a while to allow restarted nodes can be detected by others
- name: Sleep a while
run: sleep 300

- name: Stop the local network and upload logs
if: always()
uses: maidsafe/ant-local-testnet-action@main
with:
action: stop
log_file_prefix: safe_test_logs_churn
platform: ${{ matrix.os }}

- name: Get total node count
shell: bash
timeout-minutes: 1
run: |
node_count=$(ls "${{ matrix.node_data_path }}" | wc -l)
echo "Node dir count is $node_count"

- name: Get restart of nodes using rg
shell: bash
timeout-minutes: 1
# get the counts, then the specific line, and then the digit count only
# then check we have an expected level of restarts
# TODO: make this use an env var, or relate to testnet size
run: |
restart_count=$(rg "Node is restarting in" "${{ matrix.node_data_path }}" -c --stats | \
rg "(\d+) matches" | rg "\d+" -o)
echo "Restarted $restart_count nodes"
# - name: Get restart of nodes using rg
# shell: bash
# timeout-minutes: 1
# # get the counts, then the specific line, and then the digit count only
# # then check we have an expected level of restarts
# # TODO: make this use an env var, or relate to testnet size
# run: |
# restart_count=$(rg "Node is restarting in" "${{ matrix.node_data_path }}" -c --stats | \
# rg "(\d+) matches" | rg "\d+" -o)
# echo "Restarted $restart_count nodes"

# `PeerRemovedFromRoutingTable` now only happens when a peer reported as `BadNode`.
# Otherwise kad will remove a `dropped out node` directly from RT.
Expand Down
Loading
Loading