File tree Expand file tree Collapse file tree
account-comparison/programs/account-comparison/tests
close/programs/close/tests
create/programs/create/tests
reinit/programs/reinit/tests
update/programs/update/tests
anchor/programs/counter/tests
create-and-update/programs/create-and-update/tests
nullifier/programs/nullifier/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,7 +54,16 @@ async fn start_validator_and_connect() -> LightClient {
5454 tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
5555 rpc = LightClient :: new ( LightClientConfig :: local ( ) ) . await . unwrap ( ) ;
5656 }
57- tokio:: time:: sleep ( Duration :: from_secs ( 10 ) ) . await ;
57+
58+ // Wait for the indexer + prover to be ready (not just the validator RPC),
59+ // otherwise proof requests race the still-initializing indexer/prover.
60+ for attempt in 0 ..120 {
61+ if matches ! ( rpc. get_indexer_health( None ) . await , Ok ( true ) ) {
62+ break ;
63+ }
64+ assert ! ( attempt < 119 , "indexer did not become healthy in time" ) ;
65+ tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
66+ }
5867
5968 rpc
6069}
Original file line number Diff line number Diff line change @@ -52,7 +52,16 @@ async fn start_validator_and_connect() -> LightClient {
5252 tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
5353 rpc = LightClient :: new ( LightClientConfig :: local ( ) ) . await . unwrap ( ) ;
5454 }
55- tokio:: time:: sleep ( Duration :: from_secs ( 10 ) ) . await ;
55+
56+ // Wait for the indexer + prover to be ready (not just the validator RPC),
57+ // otherwise proof requests race the still-initializing indexer/prover.
58+ for attempt in 0 ..120 {
59+ if matches ! ( rpc. get_indexer_health( None ) . await , Ok ( true ) ) {
60+ break ;
61+ }
62+ assert ! ( attempt < 119 , "indexer did not become healthy in time" ) ;
63+ tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
64+ }
5665
5766 rpc
5867}
Original file line number Diff line number Diff line change @@ -51,7 +51,16 @@ async fn start_validator_and_connect() -> LightClient {
5151 tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
5252 rpc = LightClient :: new ( LightClientConfig :: local ( ) ) . await . unwrap ( ) ;
5353 }
54- tokio:: time:: sleep ( Duration :: from_secs ( 10 ) ) . await ;
54+
55+ // Wait for the indexer + prover to be ready (not just the validator RPC),
56+ // otherwise proof requests race the still-initializing indexer/prover.
57+ for attempt in 0 ..120 {
58+ if matches ! ( rpc. get_indexer_health( None ) . await , Ok ( true ) ) {
59+ break ;
60+ }
61+ assert ! ( attempt < 119 , "indexer did not become healthy in time" ) ;
62+ tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
63+ }
5564
5665 rpc
5766}
Original file line number Diff line number Diff line change @@ -55,7 +55,16 @@ async fn start_validator_and_connect() -> LightClient {
5555 tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
5656 rpc = LightClient :: new ( LightClientConfig :: local ( ) ) . await . unwrap ( ) ;
5757 }
58- tokio:: time:: sleep ( Duration :: from_secs ( 10 ) ) . await ;
58+
59+ // Wait for the indexer + prover to be ready (not just the validator RPC),
60+ // otherwise proof requests race the still-initializing indexer/prover.
61+ for attempt in 0 ..120 {
62+ if matches ! ( rpc. get_indexer_health( None ) . await , Ok ( true ) ) {
63+ break ;
64+ }
65+ assert ! ( attempt < 119 , "indexer did not become healthy in time" ) ;
66+ tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
67+ }
5968
6069 rpc
6170}
Original file line number Diff line number Diff line change @@ -54,7 +54,16 @@ async fn start_validator_and_connect() -> LightClient {
5454 tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
5555 rpc = LightClient :: new ( LightClientConfig :: local ( ) ) . await . unwrap ( ) ;
5656 }
57- tokio:: time:: sleep ( Duration :: from_secs ( 10 ) ) . await ;
57+
58+ // Wait for the indexer + prover to be ready (not just the validator RPC),
59+ // otherwise proof requests race the still-initializing indexer/prover.
60+ for attempt in 0 ..120 {
61+ if matches ! ( rpc. get_indexer_health( None ) . await , Ok ( true ) ) {
62+ break ;
63+ }
64+ assert ! ( attempt < 119 , "indexer did not become healthy in time" ) ;
65+ tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
66+ }
5867
5968 rpc
6069}
Original file line number Diff line number Diff line change @@ -55,7 +55,16 @@ async fn start_validator_and_connect() -> LightClient {
5555 tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
5656 rpc = LightClient :: new ( LightClientConfig :: local ( ) ) . await . unwrap ( ) ;
5757 }
58- tokio:: time:: sleep ( Duration :: from_secs ( 10 ) ) . await ;
58+
59+ // Wait for the indexer + prover to be ready (not just the validator RPC),
60+ // otherwise proof requests race the still-initializing indexer/prover.
61+ for attempt in 0 ..120 {
62+ if matches ! ( rpc. get_indexer_health( None ) . await , Ok ( true ) ) {
63+ break ;
64+ }
65+ assert ! ( attempt < 119 , "indexer did not become healthy in time" ) ;
66+ tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
67+ }
5968
6069 rpc
6170}
Original file line number Diff line number Diff line change @@ -51,7 +51,16 @@ async fn start_validator_and_connect() -> LightClient {
5151 tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
5252 rpc = LightClient :: new ( LightClientConfig :: local ( ) ) . await . unwrap ( ) ;
5353 }
54- tokio:: time:: sleep ( Duration :: from_secs ( 10 ) ) . await ;
54+
55+ // Wait for the indexer + prover to be ready (not just the validator RPC),
56+ // otherwise proof requests race the still-initializing indexer/prover.
57+ for attempt in 0 ..120 {
58+ if matches ! ( rpc. get_indexer_health( None ) . await , Ok ( true ) ) {
59+ break ;
60+ }
61+ assert ! ( attempt < 119 , "indexer did not become healthy in time" ) ;
62+ tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
63+ }
5564
5665 rpc
5766}
Original file line number Diff line number Diff line change @@ -51,7 +51,16 @@ async fn start_validator_and_connect() -> LightClient {
5151 tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
5252 rpc = LightClient :: new ( LightClientConfig :: local ( ) ) . await . unwrap ( ) ;
5353 }
54- tokio:: time:: sleep ( Duration :: from_secs ( 10 ) ) . await ;
54+
55+ // Wait for the indexer + prover to be ready (not just the validator RPC),
56+ // otherwise proof requests race the still-initializing indexer/prover.
57+ for attempt in 0 ..120 {
58+ if matches ! ( rpc. get_indexer_health( None ) . await , Ok ( true ) ) {
59+ break ;
60+ }
61+ assert ! ( attempt < 119 , "indexer did not become healthy in time" ) ;
62+ tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
63+ }
5564
5665 rpc
5766}
Original file line number Diff line number Diff line change @@ -50,7 +50,16 @@ async fn start_validator_and_connect() -> LightClient {
5050 tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
5151 rpc = LightClient :: new ( LightClientConfig :: local ( ) ) . await . unwrap ( ) ;
5252 }
53- tokio:: time:: sleep ( Duration :: from_secs ( 10 ) ) . await ;
53+
54+ // Wait for the indexer + prover to be ready (not just the validator RPC),
55+ // otherwise proof requests race the still-initializing indexer/prover.
56+ for attempt in 0 ..120 {
57+ if matches ! ( rpc. get_indexer_health( None ) . await , Ok ( true ) ) {
58+ break ;
59+ }
60+ assert ! ( attempt < 119 , "indexer did not become healthy in time" ) ;
61+ tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
62+ }
5463
5564 rpc
5665}
Original file line number Diff line number Diff line change @@ -52,7 +52,16 @@ async fn start_validator_and_connect() -> LightClient {
5252 tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
5353 rpc = LightClient :: new ( LightClientConfig :: local ( ) ) . await . unwrap ( ) ;
5454 }
55- tokio:: time:: sleep ( Duration :: from_secs ( 10 ) ) . await ;
55+
56+ // Wait for the indexer + prover to be ready (not just the validator RPC),
57+ // otherwise proof requests race the still-initializing indexer/prover.
58+ for attempt in 0 ..120 {
59+ if matches ! ( rpc. get_indexer_health( None ) . await , Ok ( true ) ) {
60+ break ;
61+ }
62+ assert ! ( attempt < 119 , "indexer did not become healthy in time" ) ;
63+ tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
64+ }
5665
5766 rpc
5867}
You can’t perform that action at this time.
0 commit comments