()
| 567 | |
| 568 | #[tokio::test] |
| 569 | async fn run_handle_only_cancels_current_run() { |
| 570 | let store = Arc::new(InMemoryRunStore::new()); |
| 571 | let run = store.create_run("session-1", "fix tests").await; |
| 572 | let cancel_token = Arc::new(Mutex::new(Some(CancellationToken::new()))); |
| 573 | let current_run_id = Arc::new(Mutex::new(Some(run.id.clone()))); |
| 574 | let handle = RunHandle::new( |
| 575 | run.id.clone(), |
| 576 | run.session_id.clone(), |
| 577 | store.clone(), |
| 578 | cancel_token, |
| 579 | current_run_id.clone(), |
| 580 | None, |
| 581 | ); |
| 582 | |
| 583 | assert!(handle.cancel().await); |
| 584 | assert_eq!(handle.status().await, Some(RunStatus::Cancelled)); |
| 585 | |
| 586 | *current_run_id.lock().await = Some("other-run".to_string()); |
| 587 | assert!(!handle.cancel().await); |
| 588 | } |
| 589 | } |
nothing calls this directly
no test coverage detected