Skip to content

Commit

Permalink
Fix exit code and speed up docker build.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmygchen committed May 31, 2024
1 parent e7a6f0f commit 5aa0b56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/local-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

jobs:
dockerfile-ubuntu:
runs-on: ubuntu-22.04
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

Expand Down
14 changes: 7 additions & 7 deletions scripts/tests/doppelganger_protection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ fi

function exit_and_dump_logs() {
local exit_code=$1
echo "Shutting down"
echo "Shutting down..."
$SCRIPT_DIR/../local_testnet/stop_local_testnet.sh $ENCLAVE_NAME
echo "Done"
echo "Test completed with exit code $exit_code."
exit $exit_code
}

Expand Down Expand Up @@ -55,7 +55,7 @@ GENESIS_DELAY=`curl -s $http_address/eth/v1/config/spec | jq '.data.GENESIS_DELA

CURRENT_TIME=`date +%s`
# Note: doppelganger protection can only be started post epoch 0
echo "Waiting until next epoch before starting the next validator client"
echo "Waiting until next epoch before starting the next validator client..."
DELAY=$(( $SECONDS_PER_SLOT * 32 + $GENESIS_DELAY + $MIN_GENESIS_TIME - $CURRENT_TIME))
sleep $DELAY

Expand All @@ -65,7 +65,7 @@ bn_2_port=4000

if [[ "$BEHAVIOR" == "failure" ]]; then

echo "Starting the doppelganger validator client"
echo "Starting the doppelganger validator client."

# Use same keys as keys from VC1 and connect to BN2
# This process should not last longer than 2 epochs
Expand All @@ -91,18 +91,18 @@ if [[ "$BEHAVIOR" == "failure" ]]; then
doppelganger_exit=$(run_command_without_exit "timeout $(( $SECONDS_PER_SLOT * 32 * 2 )) bash -c \"$check_exit_cmd\"")

if [[ $doppelganger_exit -eq 1 ]]; then
echo "Test failed: expected doppelganger but VC is still running. Check the logs for details."
echo "Test passed: doppelganger found and VC process stopped successfully."
exit_and_dump_logs 0
else
echo "Test passed: doppelganger found and VC process stopped successfully."
echo "Test failed: expected doppelganger but VC is still running. Check the logs for details."
exit_and_dump_logs 1
fi

fi

if [[ "$BEHAVIOR" == "success" ]]; then

echo "Starting the last validator client"
echo "Starting the last validator client."

vc_4_range_start=$(($KEYS_PER_NODE * 3))
vc_4_range_end=$(($KEYS_PER_NODE * 4 - 1))
Expand Down

0 comments on commit 5aa0b56

Please sign in to comment.