fix(qa): reject duplicate sibling bench cases · openclaw/openclaw@8e6624c
vincentkoc
·
2026-06-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -91,6 +91,9 @@ describe("gateway restart benchmark script", () => {
|
91 | 91 | "--output requires a value", |
92 | 92 | ); |
93 | 93 | expect(() => testing.parseOptions(["--case"])).toThrow("--case requires a value"); |
| 94 | +expect(() => |
| 95 | +testing.parseOptions(["--case", "skipChannels", "--case", "skipChannels"]), |
| 96 | +).toThrow('Duplicate --case "skipChannels"'); |
94 | 97 | expect(() => testing.parseOptions(["--restarts", "--runs", "1"])).toThrow( |
95 | 98 | "--restarts requires a value", |
96 | 99 | ); |
@@ -117,6 +120,34 @@ describe("gateway restart benchmark script", () => {
|
117 | 120 | expect(result.stderr).not.toContain("\n at "); |
118 | 121 | }); |
119 | 122 | |
| 123 | +it("reports duplicate benchmark cases without a stack trace", () => { |
| 124 | +const result = spawnSync( |
| 125 | +process.execPath, |
| 126 | +[ |
| 127 | +"--import", |
| 128 | +"tsx", |
| 129 | +"scripts/bench-gateway-restart.ts", |
| 130 | +"--case", |
| 131 | +"skipChannels", |
| 132 | +"--case", |
| 133 | +"skipChannels", |
| 134 | +], |
| 135 | +{ |
| 136 | +cwd: process.cwd(), |
| 137 | +encoding: "utf8", |
| 138 | +env: { |
| 139 | + ...process.env, |
| 140 | +NODE_NO_WARNINGS: "1", |
| 141 | +}, |
| 142 | +}, |
| 143 | +); |
| 144 | + |
| 145 | +expect(result.status).toBe(1); |
| 146 | +expect(result.stdout).toBe(""); |
| 147 | +expect(result.stderr.trim()).toBe('Duplicate --case "skipChannels"'); |
| 148 | +expect(result.stderr).not.toContain("\n at "); |
| 149 | +}); |
| 150 | + |
120 | 151 | it("guards the SIGUSR1 restart benchmark on Windows", () => { |
121 | 152 | expect(() => testing.ensureSupportedRestartPlatform("linux")).not.toThrow(); |
122 | 153 | expect(() => testing.ensureSupportedRestartPlatform("darwin")).not.toThrow(); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。