refactor(maestro): finish moving the e2e harness off raw reqwest
Restores the harness's deliberate 5s per-request budget, which the shared client's 30s default had silently replaced, and converts the last two hand-rolled daemon calls in e2e.rs (recent-dirs, gitroot). Drops reqwest from maestro-e2e entirely. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit was merged in pull request #40.
This commit is contained in:
co-authored by
Claude Opus 5
parent
148f97fa71
commit
ef3d314296
@@ -8,6 +8,7 @@
|
||||
#![allow(clippy::result_large_err)]
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use futures_util::{SinkExt, StreamExt};
|
||||
use maestro_protocol::{CatalogEvent, CreateSessionRequest, DaemonClient, Session};
|
||||
@@ -33,10 +34,14 @@ pub struct TestClient {
|
||||
daemon: DaemonClient,
|
||||
}
|
||||
|
||||
/// Per-request budget. Well below the client default: a hung daemon should fail
|
||||
/// the test, not stall the suite for 30s.
|
||||
const TEST_TIMEOUT: Duration = Duration::from_secs(5);
|
||||
|
||||
impl TestClient {
|
||||
pub fn new(http_base: &str) -> Self {
|
||||
Self {
|
||||
daemon: DaemonClient::new(http_base),
|
||||
daemon: DaemonClient::with_timeouts(http_base, TEST_TIMEOUT, TEST_TIMEOUT),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,9 +50,11 @@ impl Daemon {
|
||||
format!("http://{}", self.bind_addr)
|
||||
}
|
||||
|
||||
/// Shared client bound to this daemon.
|
||||
/// Shared client bound to this daemon, with the harness's tighter budget.
|
||||
pub fn client(&self) -> maestro_protocol::DaemonClient {
|
||||
maestro_protocol::DaemonClient::new(self.http_base())
|
||||
crate::client::TestClient::new(&self.http_base())
|
||||
.daemon()
|
||||
.clone()
|
||||
}
|
||||
|
||||
/// Stop the underlying process, but keep its state dirs around so we can
|
||||
|
||||
Reference in New Issue
Block a user