()
| 837 | |
| 838 | #[tokio::test] |
| 839 | async fn touch_updates_last_used_at_ms() { |
| 840 | let manager = McpManager::new(); |
| 841 | // Without a real connect, last_used is None. |
| 842 | assert!(manager.last_used_at_ms("svc-a").await.is_none()); |
| 843 | manager.touch("svc-a").await; |
| 844 | let t1 = manager.last_used_at_ms("svc-a").await.expect("set"); |
| 845 | assert!(t1 > 0); |
| 846 | // Touch again — timestamp must be monotonically non-decreasing. |
| 847 | manager.touch("svc-a").await; |
| 848 | let t2 = manager.last_used_at_ms("svc-a").await.expect("set again"); |
| 849 | assert!(t2 >= t1); |
| 850 | } |
| 851 | |
| 852 | #[tokio::test] |
| 853 | async fn disconnect_idle_drops_stale_servers_and_keeps_fresh_ones() { |
nothing calls this directly
no test coverage detected