| 183 | |
| 184 | #[tokio::test] |
| 185 | async fn test_set_retry() { |
| 186 | let mgr = SessionStatusManager::new(); |
| 187 | mgr.set_retry("ses_123", 2, "Rate limited".to_string(), 1700000000000) |
| 188 | .await; |
| 189 | let status = mgr.get("ses_123").await; |
| 190 | match status { |
| 191 | SessionStatusInfo::Retry { |
| 192 | attempt, |
| 193 | message, |
| 194 | next, |
| 195 | } => { |
| 196 | assert_eq!(attempt, 2); |
| 197 | assert_eq!(message, "Rate limited"); |
| 198 | assert_eq!(next, 1700000000000); |
| 199 | } |
| 200 | _ => panic!("Expected Retry status"), |
| 201 | } |
| 202 | assert!(mgr.is_busy("ses_123").await); |
| 203 | } |
| 204 | |
| 205 | #[tokio::test] |
| 206 | async fn test_list() { |