Skip to content

Commit 72e84d0

Browse files
author
Wilfred Almeida, Kartik Soneji
committed
wait for test validator to start
1 parent 933294b commit 72e84d0

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/cli/test.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ diff_test() {
199199
solana-test-validator --reset > validator.log 2>&1 &
200200
validator_pid=$!
201201

202+
# Wait a bit for validator to start
203+
sleep 8
204+
202205
# Set required environment variables for the deploy
203206
export ANCHOR_PROVIDER_URL="http://127.0.0.1:8899"
204207
export ANCHOR_WALLET="${workspace_dir}/tests/cli/keypairs/test-key.json"
@@ -312,7 +315,7 @@ EOF
312315
sleep 8
313316

314317

315-
anchor_cli deploy
318+
anchor_cli deploy > deploy.log 2>&1
316319
# wait for confirmation
317320
sleep 3
318321

@@ -418,6 +421,9 @@ EOF
418421
solana-test-validator --reset > validator.log 2>&1 &
419422
validator_pid=$!
420423

424+
# Wait a bit for validator to start
425+
sleep 8
426+
421427
anchor_migrate_output=$(anchor_cli migrate 2>&1)
422428
anchor_migrate_exit_code="$?"
423429

@@ -442,15 +448,16 @@ EOF
442448

443449
cd test-program
444450

445-
anchor_cli build
451+
anchor_cli build > build.log 2>&1
446452

447453
solana-test-validator --reset > validator.log 2>&1 &
448454
validator_pid=$!
449455

450-
anchor_cli deploy
451-
452-
sleep 3
456+
# Wait a bit for validator to start
457+
sleep 8
453458

459+
anchor_cli deploy > deploy.log 2>&1
460+
454461
anchor_upgrade_output=$(anchor_cli upgrade target/deploy/test_program.so \
455462
--program-id aaLWzFHRPNhQwft1971qmPg2Q5eHwsHEWivqSkCDo9x 2>&1)
456463
anchor_upgrade_exit_code="$?"

0 commit comments

Comments
 (0)