From 08016876871f3faea2be281964ce4e0e5fa1245f Mon Sep 17 00:00:00 2001 From: ethanoroshiba Date: Wed, 27 Nov 2024 08:52:23 -0600 Subject: [PATCH] don't error out waiting for collectors or executor --- crates/astria-composer/src/composer.rs | 30 ++++--------------- .../tests/blackbox/executor.rs | 15 ++++------ 2 files changed, 11 insertions(+), 34 deletions(-) diff --git a/crates/astria-composer/src/composer.rs b/crates/astria-composer/src/composer.rs index f258149034..ff5a0ee224 100644 --- a/crates/astria-composer/src/composer.rs +++ b/crates/astria-composer/src/composer.rs @@ -272,33 +272,15 @@ impl Composer { wait_for_collectors(&geth_collector_statuses, composer_status_sender.clone()); let executor_startup_fut = wait_for_executor(executor_status, composer_status_sender); - let startup_success = match join!(collectors_startup_fut, executor_startup_fut) { - (Ok(()), Ok(())) => true, - (Err(e), _) => { - error!(%e, "geth collectors failed to become ready"); - let _ = exit_err.set(e); - false - } - (_, Err(e)) => { - error!(%e, "executor failed to become ready"); - let _ = exit_err.set(e); - false + match join!(collectors_startup_fut, executor_startup_fut) { + (Ok(()), Ok(())) => {} + (Err(e), Ok(())) => error!(%e, "geth collectors failed to become ready"), + (Ok(()), Err(e)) => error!(%e, "executor failed to become ready"), + (Err(collector_err), Err(executor_err)) => { + error!(%collector_err, %executor_err, "geth collectors and executor failed to become ready"); } }; - if !startup_success { - return ShutdownInfo { - api_server_shutdown_token, - composer_shutdown_token: shutdown_token, - api_server_task_handle: Some(api_task), - executor_task_handle: Some(executor_task), - grpc_server_task_handle: None, - geth_collector_tasks, - } - .run() - .await; - } - // run the grpc server let mut grpc_server_handle = tokio::spawn(async move { grpc_server diff --git a/crates/astria-composer/tests/blackbox/executor.rs b/crates/astria-composer/tests/blackbox/executor.rs index 4abf7dd733..32b5ce321a 100644 --- a/crates/astria-composer/tests/blackbox/executor.rs +++ b/crates/astria-composer/tests/blackbox/executor.rs @@ -17,6 +17,7 @@ use crate::helper::{ mount_broadcast_tx_sync_rollup_data_submissions_mock, signed_tx_from_request, spawn_composer, + TEST_CHAIN_ID, }; /// Test to check that the executor sends a signed transaction to the sequencer after its @@ -203,20 +204,14 @@ async fn two_rollup_data_submissions_single_bundle() { /// ID #[tokio::test] async fn chain_id_mismatch_returns_error() { - // TODO(https://github.com/astriaorg/astria/issues/1833): this test will currently succeed if - // the executor fails for any reason on startup, not just if the chain ID is incorrect. This is - // a symptom of the current implementation of executor, though, which should be propagating - // errors. As such, I think it is out of the scope for the following test-only changes and - // should be fixed in a followup. - let bad_chain_id = "bad_id"; let test_composer = spawn_composer(&["test1"], Some(bad_chain_id), false).await; let err = test_composer.composer.await.unwrap().unwrap_err(); for cause in err.chain() { - if cause - .to_string() - .contains("executor failed while waiting for it to become ready") - { + println!("{cause}"); + if cause.to_string().contains(&format!( + "expected chain ID `{TEST_CHAIN_ID}`, but received `{bad_chain_id}`" + )) { return; } }