(t *testing.T)
| 322 | } |
| 323 | |
| 324 | func TestTask_Cleanup_KeepsActive(t *testing.T) { |
| 325 | tm := NewTaskManager() |
| 326 | |
| 327 | task := tm.Create("sess-1", 1, "exec") |
| 328 | tm.BindCommand("sess-1", 1, "cmd_001") |
| 329 | |
| 330 | // Running task should not be cleaned up even if old. |
| 331 | task.mu.Lock() |
| 332 | task.UpdatedAt = time.Now().Add(-10 * time.Minute) |
| 333 | task.mu.Unlock() |
| 334 | |
| 335 | tm.Cleanup(5 * time.Minute) |
| 336 | |
| 337 | if tm.Get("sess-1", 1) == nil { |
| 338 | t.Error("running task should NOT be cleaned up") |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | func TestTask_Cleanup_KeepsRecentCompleted(t *testing.T) { |
| 343 | tm := NewTaskManager() |
nothing calls this directly
no test coverage detected