MCPcopy Create free account
hub / github.com/base/base / window

Function window

acceptance/src/runner.rs:601–635  ·  view source on GitHub ↗

Runs one fork-window wait against a scripted builder with a short poll interval.

(
        replies: Vec<(u16, String)>,
        before: bool,
        budget: Duration,
    )

Source from the content-addressed store, hash-verified

599
600 /// Runs one fork-window wait against a scripted builder with a short poll interval.
601 async fn window(
602 replies: Vec<(u16, String)>,
603 before: bool,
604 budget: Duration,
605 ) -> (Option<(Status, String)>, ScenarioResult) {
606 let mut config = ScenarioConfig::load("scenarios/smoke.toml").unwrap();
607 config.readiness.poll_interval = Span(Duration::from_millis(10));
608 let endpoints = BTreeMap::from([("builder".into(), scripted(replies).await)]);
609 let mut result = CliRun::fatal(&config, String::new());
610 result.forks.push(ForkBoundary {
611 name: "denim".into(),
612 chain: "l2".into(),
613 activation_timestamp: DENIM_ACTIVATION,
614 observed_block: None,
615 observed_elapsed_ms: None,
616 });
617 let start = CheckStart {
618 chain: "l2".into(),
619 before_fork: before.then(|| "denim".into()),
620 after_fork: (!before).then(|| "denim".into()),
621 };
622 let observer = RpcObserver::new(Duration::from_secs(1), Duration::from_millis(10)).unwrap();
623 let outcome = AcceptanceRunner::open_window(
624 &observer,
625 &config,
626 &endpoints,
627 &start,
628 &mut result,
629 Instant::now(),
630 Instant::now() + budget,
631 )
632 .await
633 .unwrap();
634 (outcome, result)
635 }
636
637 #[tokio::test]
638 async fn fork_wait_retries_transient_builder_failures() {

Calls 4

SpanClass · 0.85
scriptedFunction · 0.85
newFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected