(t *testing.T)
| 248 | } |
| 249 | |
| 250 | func 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 | |
| 269 | func TestSystem_Stats(t *testing.T) { |
| 270 | system := NewSystem("test") |