Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
WIP: change over background executor test helpers
Mikaylad66ed4310fd9
diff --git a/crates/collab2/src/executor.rs b/crates/collab2/src/executor.rsindex 6d33374e55b..81d5e977a6f 100644--- a/crates/collab2/src/executor.rs+++ b/crates/collab2/src/executor.rs@@ -36,12 +36,4 @@ impl Executor {}}}-- pub fn record_backtrace(&self) {- match self {- Executor::Production => {}- #[cfg(test)]- Executor::Deterministic(background) => background.record_backtrace(),- }- }}diff --git a/crates/collab2/src/rpc.rs b/crates/collab2/src/rpc.rsindex 7e847e8bffd..835b48809da 100644--- a/crates/collab2/src/rpc.rs+++ b/crates/collab2/src/rpc.rs@@ -110,7 +110,7 @@ struct Session {peer: Arc<Peer>,connection_pool: Arc<parking_lot::Mutex<ConnectionPool>>,live_kit_client: Option<Arc<dyn live_kit_server::api::Client>>,- executor: Executor,+ _executor: Executor,}impl Session {@@ -612,7 +612,7 @@ impl Server {peer: this.peer.clone(),connection_pool: this.connection_pool.clone(),live_kit_client: this.app_state.live_kit_client.clone(),- executor: executor.clone(),+ _executor: executor.clone()};update_user_contacts(user_id, &session).await?;@@ -1723,7 +1723,6 @@ async fn update_language_server(request: proto::UpdateLanguageServer,session: Session,) -> Result<()> {- session.executor.record_backtrace();let project_id = ProjectId::from_proto(request.project_id);let project_connection_ids = session.db()@@ -1750,7 +1749,6 @@ async fn forward_project_request<T>(whereT: EntityMessage + RequestMessage,{- session.executor.record_backtrace();let project_id = ProjectId::from_proto(request.remote_entity_id());let host_connection_id = {let collaborators = session@@ -1778,7 +1776,6 @@ async fn create_buffer_for_peer(request: proto::CreateBufferForPeer,session: Session,) -> Result<()> {- session.executor.record_backtrace();let peer_id = request.peer_id.ok_or_else(|| anyhow!("invalid peer id"))?;session.peer@@ -1791,7 +1788,6 @@ async fn update_buffer(response: Response<proto::UpdateBuffer>,session: Session,) -> Result<()> {- session.executor.record_backtrace();let project_id = ProjectId::from_proto(request.project_id);let mut guest_connection_ids;let mut host_connection_id = None;@@ -1812,7 +1808,6 @@ async fn update_buffer(}let host_connection_id = host_connection_id.ok_or_else(|| anyhow!("host not found"))?;- session.executor.record_backtrace();broadcast(Some(session.connection_id),guest_connection_ids,diff --git a/crates/gpui2/src/executor.rs b/crates/gpui2/src/executor.rsindex 4523af4aaf8..4e434da8cc7 100644--- a/crates/gpui2/src/executor.rs+++ b/crates/gpui2/src/executor.rs@@ -222,11 +222,6 @@ impl BackgroundExecutor {self.dispatcher.as_test().unwrap().allow_parking();}- #[cfg(any(test, feature = "test-support"))]- pub fn record_backtrace(&self) {- self.dispatcher.as_test().unwrap().record_backtrace();- }-#[cfg(any(test, feature = "test-support"))]pub fn rng(&self) -> StdRng {self.dispatcher.as_test().unwrap().rng()diff --git a/crates/gpui2/src/platform/test/dispatcher.rs b/crates/gpui2/src/platform/test/dispatcher.rsindex 01dcc9409bf..258c484063c 100644--- a/crates/gpui2/src/platform/test/dispatcher.rs+++ b/crates/gpui2/src/platform/test/dispatcher.rs@@ -128,12 +128,8 @@ impl TestDispatcher {})}- pub fn record_backtrace(&self) {- todo!("record_backtrace")- }-pub fn rng(&self) -> StdRng {- todo!("rng")+ self.state.lock().random.clone()}}