MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / TestTask_ActiveBySession

Function TestTask_ActiveBySession

internal/bridge/taskmanager_test.go:288–300  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

286}
287
288func TestTask_ActiveBySession(t *testing.T) {
289 tm := NewTaskManager()
290 tm.Create("sess-1", 1, "exec")
291 tm.Create("sess-1", 2, "netstat")
292 tm.Create("sess-1", 3, "ls")
293
294 tm.Complete("sess-1", 2)
295
296 active := tm.ActiveBySession("sess-1")
297 if len(active) != 2 {
298 t.Errorf("ActiveBySession: got %d, want 2 (tasks 1 and 3)", len(active))
299 }
300}
301
302func TestTask_Cleanup_RemovesStale(t *testing.T) {
303 tm := NewTaskManager()

Callers

nothing calls this directly

Calls 4

CreateMethod · 0.95
CompleteMethod · 0.95
ActiveBySessionMethod · 0.95
NewTaskManagerFunction · 0.85

Tested by

no test coverage detected