Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .test_patterns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ tests:
owners:
- *palla

- regex: "yarn-project/end-to-end/scripts/run_test.sh ha src/composed/ha/e2e_ha_full.test.ts"
- regex: "yarn-project/end-to-end/scripts/run_test.sh ha src/composed/ha/e2e_ha_full.parallel.test.ts"
owners:
- *spyros

Expand Down
8 changes: 7 additions & 1 deletion yarn-project/end-to-end/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ function test_cmds {
)
for test in "${tests[@]}"; do
# We must set ONLY_TERM_PARENT=1 to allow the script to fully control cleanup process.
echo "$hash:ONLY_TERM_PARENT=1:TIMEOUT=30m $run_test_script ha $test"
if [[ "$test" == *.parallel.test.ts ]]; then
while IFS= read -r test_name; do
echo "$hash:ONLY_TERM_PARENT=1:TIMEOUT=30m $run_test_script ha $test \"$test_name\""
done < <(extract_test_names "$test")
else
echo "$hash:ONLY_TERM_PARENT=1:TIMEOUT=30m $run_test_script ha $test"
fi
done

#echo "$hash:ONLY_TERM_PARENT=1 $run_test_script simple src/e2e_multi_validator/e2e_multi_validator_node.test.ts"
Expand Down
17 changes: 3 additions & 14 deletions yarn-project/end-to-end/scripts/ha/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ services:
volumes:
- web3signer_keys:/keys

anvil:
image: aztecprotocol/build:3.0
cpus: 1
mem_limit: 2G
entrypoint: 'anvil --silent -p 8545 --host 0.0.0.0 --chain-id 31337'

end-to-end:
image: aztecprotocol/build:3.0
cpus: 4
Expand All @@ -51,7 +45,8 @@ services:
environment:
JEST_CACHE_DIR: /tmp-jest
LOG_LEVEL: ${LOG_LEVEL:-verbose}
ETHEREUM_HOSTS: http://anvil:8545
TEST: ${TEST:-./src/composed/ha/e2e_ha_full.parallel.test.ts}
TEST_NAME: ${TEST_NAME:-}
L1_CHAIN_ID: 31337
DATABASE_URL: postgresql://aztec:aztec@postgres:5432/aztec_ha_test
WEB3_SIGNER_URL: http://web3signer:9000
Expand All @@ -70,10 +65,6 @@ services:
while ! nc -z web3signer 9000; do sleep 1; done;
echo "Web3Signer is ready"

# Wait for anvil to be ready
while ! nc -z anvil 8545; do sleep 1; done;
echo "Anvil is ready"

# Run database migrations
echo "Running database migrations..."
cd /root/aztec-packages/yarn-project/aztec
Expand All @@ -84,7 +75,7 @@ services:
cd /root/aztec-packages/yarn-project/end-to-end

# Run the test
setsid ./scripts/test_simple.sh ${TEST:-./src/composed/ha/e2e_ha_sequencer.test.ts} &
setsid ./scripts/test_simple.sh "$${TEST}" "$${TEST_NAME}" &
pid=$$!
pgid=$$(($$(ps -o pgid= -p $$pid)))
trap "kill -SIGTERM -$$pgid" SIGTERM
Expand All @@ -96,8 +87,6 @@ services:
condition: service_healthy
web3signer:
condition: service_started
anvil:
condition: service_started

volumes:
postgres_data:
Expand Down
7 changes: 5 additions & 2 deletions yarn-project/end-to-end/scripts/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ case "$type" in
TEST=$test exec run_compose_test $test end-to-end $PWD/web3signer
;;
"ha")
# Remove volumes on cleanup for HA tests to ensure clean database state on retries
TEST=$test REMOVE_COMPOSE_VOLUMES=1 exec run_compose_test $test end-to-end $PWD/ha
# Remove volumes on cleanup for HA tests to ensure clean database state on retries.
# NAME_POSTFIX namespaces the compose project per test so parallel per-test jobs don't collide.
# Compose project names must be lowercase alphanumerics, hyphens, and underscores.
postfix=$(echo "$test_name" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/_/g')
TEST=$test TEST_NAME=$test_name NAME_POSTFIX=${postfix:+_$postfix} REMOVE_COMPOSE_VOLUMES=1 exec run_compose_test $test end-to-end $PWD/ha
;;
esac
Loading
Loading