Add a test for remote tool use by the agent (#30289)
- Adds a new smoke test for the use of the read_file tool by the agent in an SSH project - Fixes the SSH shutdown sequence to use a timer from the app's executor instead of always using a real timer - Changes the main executor loop for tests to advance the clock automatically instead of panicking with `parked with nothing left to run` when there is a delayed task Release Notes: - N/A
This commit is contained in:
parent
660b4cee76
commit
8b764a5477
9 changed files with 104 additions and 13 deletions
|
@ -18,8 +18,8 @@ use futures::{
|
|||
select, select_biased,
|
||||
};
|
||||
use gpui::{
|
||||
App, AppContext as _, AsyncApp, BorrowAppContext, Context, Entity, EventEmitter, Global,
|
||||
SemanticVersion, Task, WeakEntity,
|
||||
App, AppContext as _, AsyncApp, BackgroundExecutor, BorrowAppContext, Context, Entity,
|
||||
EventEmitter, Global, SemanticVersion, Task, WeakEntity,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use parking_lot::Mutex;
|
||||
|
@ -683,6 +683,7 @@ impl SshRemoteClient {
|
|||
pub fn shutdown_processes<T: RequestMessage>(
|
||||
&self,
|
||||
shutdown_request: Option<T>,
|
||||
executor: BackgroundExecutor,
|
||||
) -> Option<impl Future<Output = ()> + use<T>> {
|
||||
let state = self.state.lock().take()?;
|
||||
log::info!("shutting down ssh processes");
|
||||
|
@ -705,7 +706,7 @@ impl SshRemoteClient {
|
|||
// We wait 50ms instead of waiting for a response, because
|
||||
// waiting for a response would require us to wait on the main thread
|
||||
// which we want to avoid in an `on_app_quit` callback.
|
||||
smol::Timer::after(Duration::from_millis(50)).await;
|
||||
executor.timer(Duration::from_millis(50)).await;
|
||||
}
|
||||
|
||||
// Drop `multiplex_task` because it owns our ssh_proxy_process, which is a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue