Files
HomeAgent/internal/plugin/proc/race_on.go
JianFeeeee 7f68d2b1bf test(proc): 流式发布耗时判据改为 race 感知阈值
CI 红(run 40473247694,Race detector job):
  --- FAIL: TestStreaming_PublishLatencyFlatAcrossSubscribers
  1 个消费者:8.81662ms(均摊 2.938µs/次)
  8 个消费者:36.407338ms(均摊 12.135µs/次)→ >4 倍判据
与该次提交的内容无关(改动都在 agent/core、memory、qq 插件级别与
scheduler 日志),是"按耗时比值"的判据在共享 runner + -race 下抖动。

改法(不削弱拦截能力):
- 常规构建阈值 4 倍(本机实测 1.1~1.5 倍);
- -race 构建阈值 6 倍(影子内存检查放大常数因子);
- 两者都低于 O(N) 广播的 8 倍量级,真出现线性恶化仍会被抓。
新增 race_off.go / race_on.go 提供 raceEnabled 常量(build tag 判定),
而不是用环境变量或时间门槛(后者要么本机永远跳过、要么 CI 永远误报)。

刻意**没有**改成"重复测量取最小值":实测会让本用例成本 ×3,-race 下
撞 600s 超时(试过,已撤回)。
2026-10-27 17:49:05 +08:00

7 lines
129 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//go:build race
package proc
// raceEnabled 见 race_off.go 的说明(-race 构建时为 true)。
const raceEnabled = true