MCPcopy Create free account
hub / github.com/astercloud/aster / TestInMemoryTaskStore_Cancellation

Function TestInMemoryTaskStore_Cancellation

pkg/a2a/store_test.go:88–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

86}
87
88func TestInMemoryTaskStore_Cancellation(t *testing.T) {
89 store := NewInMemoryTaskStore()
90 task := NewTask("task-1", "context-1")
91
92 // 添加取消信号
93 store.AddCancellation(task.ID)
94
95 // 检查取消状态
96 canceled := store.IsCanceled(task.ID)
97 assert.True(t, canceled)
98
99 // 移除取消信号
100 store.RemoveCancellation(task.ID)
101
102 // 再次检查
103 canceled = store.IsCanceled(task.ID)
104 assert.False(t, canceled)
105}
106
107func TestInMemoryTaskStore_Concurrency(t *testing.T) {
108 store := NewInMemoryTaskStore()

Callers

nothing calls this directly

Calls 5

AddCancellationMethod · 0.95
IsCanceledMethod · 0.95
RemoveCancellationMethod · 0.95
NewInMemoryTaskStoreFunction · 0.85
NewTaskFunction · 0.85

Tested by

no test coverage detected