diff --git a/Cargo.lock b/Cargo.lock index 6c274ba..f882991 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1920,6 +1920,7 @@ dependencies = [ "anstyle", "clap_lex", "strsim", + "terminal_size", ] [[package]] @@ -7838,6 +7839,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminal_size" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" +dependencies = [ + "rustix", + "windows-sys 0.59.0", +] + [[package]] name = "thiserror" version = "1.0.69" diff --git a/Cargo.toml b/Cargo.toml index 60178b6..9f602b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ ansi_term = "0.12.1" anyhow = "1.0" bson = { version = "2.15.0" } cacache = { version = "13.1.0" } -clap = { version = "4", features = ["derive"] } +clap = { version = "4", features = ["derive", "wrap_help"] } dashmap = { version = "6.1.0" } foundry-compilers-artifacts = { version = "0.18.0" } futures = { version = "0.3.31" } diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index 0228d1d..4798ad2 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -24,7 +24,7 @@ use strum::{AsRefStr, Display, EnumString, IntoStaticStr}; use temp_dir::TempDir; #[derive(Clone, Debug, Parser, Serialize, Deserialize)] -#[command(name = "retester")] +#[command(name = "retester", term_width = 100)] pub enum Context { /// Executes tests in the MatterLabs format differentially on multiple targets concurrently. Test(Box), @@ -510,7 +510,7 @@ pub struct ExportGenesisContext { impl Default for TestExecutionContext { fn default() -> Self { - Self::parse_from(["execution-context"]) + Self::parse_from(["execution-context", "--test", "."]) } } @@ -612,7 +612,7 @@ impl AsRef for TestExecutionContext { impl Default for BenchmarkingContext { fn default() -> Self { - Self::parse_from(["benchmarking-context"]) + Self::parse_from(["benchmarking-context", "--test", "."]) } } @@ -759,7 +759,7 @@ pub struct CorpusConfiguration { /// - `{metadata_file_path}::{case_idx}::{mode}`: This is very similar to the above specifier /// with the exception that in this case the mode is specified and will be used in the test. #[serde_as(as = "Vec")] - #[arg(short = 't', long = "test")] + #[arg(short = 't', long = "test", required = true)] pub test_specifiers: Vec, } diff --git a/crates/core/src/differential_tests/entry_point.rs b/crates/core/src/differential_tests/entry_point.rs index 27a6656..69a09a3 100644 --- a/crates/core/src/differential_tests/entry_point.rs +++ b/crates/core/src/differential_tests/entry_point.rs @@ -330,15 +330,18 @@ async fn start_cli_reporting_task(output_format: OutputFormat, reporter: Reporte .unwrap(); writeln!(buf).unwrap(); - buf = tokio::task::spawn_blocking(move || { - buf.flush().unwrap(); - buf - }) - .await - .unwrap(); + if aggregator_events_rx.is_empty() { + buf = tokio::task::spawn_blocking(move || { + buf.flush().unwrap(); + buf + }) + .await + .unwrap(); + } } } } + info!("Aggregator Broadcast Channel Closed"); // Summary at the end. match output_format { diff --git a/crates/node/src/provider_utils/provider.rs b/crates/node/src/provider_utils/provider.rs index f10b3b6..c8f5655 100644 --- a/crates/node/src/provider_utils/provider.rs +++ b/crates/node/src/provider_utils/provider.rs @@ -104,7 +104,7 @@ where }; debug!(%tx_hash, "Submitted Transaction"); - pending_transaction.set_timeout(Some(Duration::from_secs(120))); + pending_transaction.set_timeout(Some(Duration::from_secs(240))); let tx_hash = pending_transaction.watch().await.context(format!( "Transaction inclusion watching timeout for {tx_hash}" ))?; diff --git a/crates/report/src/aggregator.rs b/crates/report/src/aggregator.rs index 87cc379..1feda38 100644 --- a/crates/report/src/aggregator.rs +++ b/crates/report/src/aggregator.rs @@ -41,7 +41,7 @@ pub struct ReportAggregator { impl ReportAggregator { pub fn new(context: Context) -> Self { let (runner_tx, runner_rx) = unbounded_channel::(); - let (listener_tx, _) = channel::(1024); + let (listener_tx, _) = channel::(0xFFFF); Self { report: Report::new(context), remaining_cases: Default::default(), @@ -64,7 +64,7 @@ impl ReportAggregator { debug!("Starting to aggregate report"); while let Some(event) = self.runner_rx.recv().await { - debug!(?event, "Received Event"); + debug!(event = event.variant_name(), "Received Event"); match event { RunnerEvent::SubscribeToEvents(event) => { self.handle_subscribe_to_events_event(*event); diff --git a/crates/report/src/runner_event.rs b/crates/report/src/runner_event.rs index 0a142b9..fe4155a 100644 --- a/crates/report/src/runner_event.rs +++ b/crates/report/src/runner_event.rs @@ -347,6 +347,16 @@ macro_rules! define_event { ),* } + impl $ident { + pub fn variant_name(&self) -> &'static str { + match self { + $( + Self::$variant_ident { .. } => stringify!($variant_ident) + ),* + } + } + } + $( #[derive(Debug)] $(#[$variant_meta])*