fix: 修复6个边缘侧问题 + 单元测试
1. 删除 ConfigAgent (与 MQTT 配置更新重叠且未启用) 2. OTA 完整安装流程: 解压tar.gz -> 校验ELF -> 替换二进制 -> systemctl重启 3. StreamManager stopAll 添加 Wait() 防止僵尸进程 4. InferClient socket 读写添加 timeout 防止永久阻塞 5. Heartbeat 集成 NPU 监控 (npu-smi + fallback 脚本) 6. 配置更新时动态重启 ffmpeg 以应用新 fps
This commit is contained in:
25
internal/event/uploader_test.go
Normal file
25
internal/event/uploader_test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package event
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestBufferCap(t *testing.T) {
|
||||
u := &Uploader{buf: []SuspectedEvent{}}
|
||||
for i := 0; i < 600; i++ {
|
||||
u.buffer(SuspectedEvent{EventID: "test"})
|
||||
}
|
||||
if len(u.buf) != maxBuffer {
|
||||
t.Errorf("buffer len: got %d want %d", len(u.buf), maxBuffer)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUploadError(t *testing.T) {
|
||||
err := &UploadError{Fatal: true, Msg: "test error"}
|
||||
if err.Error() != "test error" {
|
||||
t.Errorf("Error(): got %q want %q", err.Error(), "test error")
|
||||
}
|
||||
if !err.Fatal {
|
||||
t.Error("Fatal flag should be true")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user