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

Function TestSystem_Stop

pkg/actor/actor_test.go:250–267  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

248}
249
250func TestSystem_Stop(t *testing.T) {
251 system := NewSystem("test")
252 defer system.Shutdown()
253
254 pid := system.Spawn(&EchoActor{}, "echo")
255
256 // Actor 应该存在
257 _, exists := system.GetActor("echo")
258 assert.True(t, exists)
259
260 // 停止 Actor
261 system.Stop(pid)
262 time.Sleep(100 * time.Millisecond)
263
264 // Actor 应该不存在
265 _, exists = system.GetActor("echo")
266 assert.False(t, exists)
267}
268
269func TestSystem_Stats(t *testing.T) {
270 system := NewSystem("test")

Callers

nothing calls this directly

Calls 5

ShutdownMethod · 0.95
SpawnMethod · 0.95
GetActorMethod · 0.95
StopMethod · 0.95
NewSystemFunction · 0.85

Tested by

no test coverage detected