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

Function TestClose

pkg/events/bus_test.go:149–164  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

147}
148
149func TestClose(t *testing.T) {
150 eb := NewEventBus()
151 ch := eb.Subscribe([]types.AgentChannel{types.ChannelProgress}, nil)
152
153 eb.Close()
154
155 // Channel should be closed
156 select {
157 case _, ok := <-ch:
158 if ok {
159 t.Error("channel should be closed")
160 }
161 case <-time.After(100 * time.Millisecond):
162 t.Error("channel read should not block")
163 }
164}
165
166// TestGetTimelineRange 测试分页获取时间线
167func TestGetTimelineRange(t *testing.T) {

Callers

nothing calls this directly

Calls 4

SubscribeMethod · 0.95
CloseMethod · 0.95
NewEventBusFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected