Skip to content

Commit dc4ebf2

Browse files
committed
test(server): 验证所有内存策略保留父切片保护
- 在既有策略矩阵中核对父切片的 CPU、I/O 权重和任务数量限制。 - 保留主机托管策略不写入子切片内存上限的回归断言。 - check:changed 通过 20 项测试及相关类型、格式和静态检查。
1 parent 75c1391 commit dc4ebf2

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎apps/server/src/process/agentScope.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,15 @@ describe("AgentScope service", () => {
200200
const limits = properties.filter((args) => args.includes("app-t3code-agents.slice"));
201201
expect(properties).toHaveLength(memoryPolicy === "host-managed" ? 1 : 2);
202202
expect(limits).toHaveLength(memoryPolicy === "host-managed" ? 0 : 1);
203+
expect(properties).toContainEqual([
204+
"--user",
205+
"set-property",
206+
"--runtime",
207+
"app-t3code.slice",
208+
"CPUWeight=10",
209+
"IOWeight=10",
210+
"TasksMax=25%",
211+
]);
203212
if (memoryPolicy !== "host-managed") {
204213
expect(limits[0]).toContain("app-t3code-agents.slice");
205214
expect(limits[0]?.some((arg) => arg.startsWith("MemoryHigh="))).toBe(true);

0 commit comments

Comments
 (0)