mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-07 13:48:43 +08:00
Merge pull request #6136 from alfadb/fix/flaky-tool-schema-alloc-guard
fix(openai): harden flaky alloc guard in tool schema sanitize test
This commit is contained in:
@@ -587,7 +587,9 @@ func TestSanitizeOpenAIResponsesToolParameterTypes_RewriteCountIndependentOfHits
|
||||
})
|
||||
|
||||
// 命中切片扩容是对数级,留出充裕余量;线性写法在这里会是 2000 量级。
|
||||
require.Less(t, largeAllocs, smallAllocs+40,
|
||||
// 干净环境实测 large 约 17 allocs,200 是 10 倍余量,同时容忍 CI 慢 pod 上
|
||||
// 包内后台 goroutine(日志/ticker)对进程级 Mallocs 的噪声污染。
|
||||
require.Less(t, largeAllocs, 200.0,
|
||||
"分配次数随命中数线性增长,说明退回了逐路径全量重写 (small=%v large=%v)", smallAllocs, largeAllocs)
|
||||
|
||||
// 同时确认大 body 的结果确实全部修好了。
|
||||
|
||||
Reference in New Issue
Block a user