Skip to content

QA - Sync from scratch (minimal node) #1315

QA - Sync from scratch (minimal node)

QA - Sync from scratch (minimal node) #1315

name: QA - Sync from scratch (minimal node)
on:
push:
branches:
- 'release/3.*'
schedule:
- cron: '0 0 * * *' # Run every night at 00:00 AM UTC
workflow_dispatch: # Run manually
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
minimal-node-sync-from-scratch-test:
runs-on: [self-hosted, qa, long-running]
timeout-minutes: 1440 # 24 hours
strategy:
fail-fast: false
matrix:
chain: [ mainnet, gnosis ] # Chain name as specified on the erigon command line
env:
ERIGON_DATA_DIR: ${{ github.workspace }}/erigon_data
ERIGON_QA_PATH: /home/qarunner/erigon-qa
ERIGON_ASSERT: true
TRACKING_TIME_SECONDS: 7200 # 2 hours
TOTAL_TIME_SECONDS: 43200 # 18 hours
CHAIN: ${{ matrix.chain }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Clean Erigon Build & Data Directories
run: |
make clean
rm -rf $ERIGON_DATA_DIR
- name: Build Erigon
run: |
make erigon
working-directory: ${{ github.workspace }}
- name: Pause the Erigon instance dedicated to db maintenance
run: |
python3 $ERIGON_QA_PATH/test_system/db-producer/pause_production.py || true
- name: Run Erigon and monitor chain sync
id: test_step
run: |
set +e # Disable exit on error
# Run Erigon, wait sync and check ability to maintain sync
python3 $ERIGON_QA_PATH/test_system/qa-tests/tip-tracking/run_and_check_tip_tracking.py \
${{ github.workspace }}/build/bin $ERIGON_DATA_DIR $TRACKING_TIME_SECONDS $TOTAL_TIME_SECONDS Erigon3 $CHAIN minimal_node
# Capture monitoring script exit status
test_exit_status=$?
# Save the subsection reached status
echo "test_executed=true" >> "$GITHUB_OUTPUT"
# Check test runner script exit status
if [ $test_exit_status -eq 0 ]; then
echo "Tests completed successfully"
echo "::notice::Tests completed successfully"
echo "TEST_RESULT=success" >> "$GITHUB_OUTPUT"
else
echo "Error detected during tests"
echo "::error::Error detected during tests"
echo "TEST_RESULT=failure" >> "$GITHUB_OUTPUT"
exit 1
fi
- name: Upload Downloader Torrent Client Status
if: ${{ always() && steps.test_step.outputs.test_executed == 'true' }}
uses: actions/upload-artifact@v6
with:
name: torrent-client-status-${{ env.CHAIN }}
path: torrent-client-status.txt
- name: Save test results
if: ${{ always() && steps.test_step.outputs.test_executed == 'true' }}
env:
TEST_RESULT: ${{ steps.test_step.outputs.TEST_RESULT }}
run: |
python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/upload_test_results.py \
--repo erigon \
--commit $(git rev-parse HEAD) \
--branch ${{ github.ref_name }} \
--test_name sync-from-scratch-minimal-node \
--chain $CHAIN \
--runner ${{ runner.name }} \
--outcome $TEST_RESULT \
--result_file ${{ github.workspace }}/result-$CHAIN.json
- name: Upload test results
if: ${{ always() && steps.test_step.outputs.test_executed == 'true' }}
uses: actions/upload-artifact@v6
with:
name: test-results-${{ env.CHAIN }}
path: |
${{ github.workspace }}/result-${{ env.CHAIN }}.json
${{ github.workspace }}/erigon_data/logs/
- name: Upload metric plots
if: ${{ always() && steps.test_step.outputs.test_executed == 'true' }}
uses: actions/upload-artifact@v6
with:
name: metric-plots-${{ env.CHAIN }}
path: ${{ github.workspace }}/metrics-${{ env.CHAIN }}-plots*
- name: Upload FD Leak Analysis
if: ${{ always() && steps.test_step.outputs.test_executed == 'true' }}
uses: actions/upload-artifact@v6
with:
name: fd-leak-analysis-${{ env.CHAIN }}
path: ${{ github.workspace }}/fd-leak-analysis-${{ env.CHAIN }}.md
- name: Clean up Erigon data directory
if: always()
run: |
rm -rf $ERIGON_DATA_DIR
- name: Resume the Erigon instance dedicated to db maintenance
if: always()
run: |
python3 $ERIGON_QA_PATH/test_system/db-producer/resume_production.py || true