diff --git a/.github/workflows/run-nitro-test-node.yml b/.github/workflows/run-nitro-test-node.yml index 03bcb1f..da9ede3 100644 --- a/.github/workflows/run-nitro-test-node.yml +++ b/.github/workflows/run-nitro-test-node.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./run-nitro-test-node - run-with-token-bridge: + run-without-token-bridge: name: "Run without token bridge deployment" runs-on: ubuntu-latest steps: @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./run-nitro-test-node with: - args: --detach + args: --pos run-with-simple: name: "Run in simple mode" diff --git a/run-nitro-test-node/action.yml b/run-nitro-test-node/action.yml index 2b0d5a7..e9984f5 100644 --- a/run-nitro-test-node/action.yml +++ b/run-nitro-test-node/action.yml @@ -19,7 +19,7 @@ inputs: description: "Additional args that can be supplied to the test node script" nitro-testnode-ref: required: false - default: "release" + default: "gz-debug" description: "The nitro-testnode branch to use" l3-node: required: false @@ -44,9 +44,6 @@ runs: - name: Start background nitro-testnode test-node.bash shell: bash - # Currently, you can't run parallel steps, so we add the "&" to run this step in the background - # - # See https://stackoverflow.com/a/72203688 for more info run: | cd nitro-testnode @@ -57,11 +54,11 @@ runs: export TOKEN_BRIDGE_BRANCH="${{ inputs.token-bridge-branch }}" fi - ./test-node.bash --init ${{ inputs.no-simple == 'true' && '--no-simple' || '' }} \ + ./test-node.bash --init-force ${{ inputs.no-simple == 'true' && '--no-simple' || '' }} \ ${{ inputs.l3-node == 'true' && '--l3node' || '' }} \ ${{ inputs.no-token-bridge == 'true' && '--no-tokenbridge' || '--tokenbridge' }} \ ${{ inputs.l3-node == 'true' && inputs.no-l3-token-bridge != 'true' && '--l3-token-bridge' || '' }} \ - ${{ inputs.args }} & + ${{ inputs.args }} --detach --nowait - name: Wait for nitro startup shell: bash diff --git a/run-nitro-test-node/waitForNitro.sh b/run-nitro-test-node/waitForNitro.sh index 8e212ba..ffa8ef7 100755 --- a/run-nitro-test-node/waitForNitro.sh +++ b/run-nitro-test-node/waitForNitro.sh @@ -2,12 +2,18 @@ PORT=${1:-8547} -while true +# timeout after around 1 minutes, should be enough because test-node.bash only detach after everything is ready +for i in {1..6} do - curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":45678,"method":"eth_chainId","params":[]}' "http://localhost:$PORT" + curl --silent -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":45678,"method":"eth_chainId","params":[]}' "http://localhost:$PORT" if [ "$?" -eq "0" ]; then + echo "nitro ready at port $PORT" exit 0 else + echo "nitro not ready yet at port $PORT" sleep 10 fi done +echo "exiting: printing docker logs for everything" +docker compose -f ./nitro-testnode/docker-compose.yaml logs +exit 1 diff --git a/run-nitro-test-node/waitForTokenBridge.sh b/run-nitro-test-node/waitForTokenBridge.sh index 3346625..47519e7 100755 --- a/run-nitro-test-node/waitForTokenBridge.sh +++ b/run-nitro-test-node/waitForTokenBridge.sh @@ -1,10 +1,15 @@ # poll the token bridge deployment file until we get a 0 return code -while true +# timeout after around 1 minutes, should be enough because test-node.bash only detach after everything is ready +for i in {1..6} do docker compose -f ./nitro-testnode/docker-compose.yaml run --entrypoint sh tokenbridge -c "cat $1" if [ "$?" -eq "0" ]; then exit 0 else + echo "token bridge not ready yet $1" sleep 10 fi done +echo "exiting: printing docker logs for tokenbridge deployment" +docker compose -f ./nitro-testnode/docker-compose.yaml logs tokenbridge +exit 1