Skip to content
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
8 changes: 8 additions & 0 deletions smoke-test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ set -euo pipefail

./test-node.bash --espresso --latest-espresso-image --validate --tokenbridge --init-force --detach

# Wait for the sequencer HTTP to be ready
echo "Waiting for sequencer HTTP to be ready..."
while ! curl -sf http://localhost:8547 > /dev/null; do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want some time limit on this or will this always eventually be ready?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, it should normally be ready at some point but nothing wrong in adding an extra check. I'm just not sure what should be the higher bound.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might not be necessary, i was just curious

Copy link
Member

@zacshowa zacshowa Apr 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't be necessary for CI but I think for the sake of not keeping things running longer than they need to we could fail and exit the script after a certain number of iterations to impose a time limit. However, we can do it in another PR.

Something like this maybe.

Suggested change
while ! curl -sf http://localhost:8547 > /dev/null; do
max_iterations=12 # Multiplied by the sleep value in the loop to calculate how long the sequencer has to start.
iterations=0
while ! curl -sf http://localhost:8547 > /dev/null; do
echo "Sequencer HTTP is not ready yet. Retrying in 5 seconds..."
sleep 5
if [$iterations -eq $max_iterations]; then
fail "Could not connect to Sequencer HTTP server after $max_iterations attempts."
fi
((iterations +=1))
done

Where fail is some function like this from the migration test:

# This is a utility function for exiting with with error strings
fail(){
    echo "$*" 1>&2; exit 1;
}

echo "Sequencer HTTP is not ready yet. Retrying in 5 seconds..."
sleep 5
done
echo "Sequencer HTTP is ready!"

# Sending L2 transaction
./test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait

Expand Down
2 changes: 1 addition & 1 deletion test-node.bash
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ done

if $espresso; then
NITRO_CONTRACTS_REPO=https://github.com/EspressoSystems/nitro-contracts.git
NITRO_CONTRACTS_BRANCH=v2.1.1-beta.0-cff556b
NITRO_CONTRACTS_BRANCH=v2.1.3-alpha
export NITRO_CONTRACTS_REPO
export NITRO_CONTRACTS_BRANCH
echo "Running espresso mode"
Expand Down
Loading