惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
博客园 - 司徒正美
V
Visual Studio Blog
博客园 - 【当耐特】
T
Tailwind CSS Blog
美团技术团队
博客园 - 叶小钗
Jina AI
Jina AI
宝玉的分享
宝玉的分享
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
雷峰网
雷峰网
Stack Overflow Blog
Stack Overflow Blog
博客园_首页
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
Martin Fowler
Martin Fowler
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(test): fail startup bench on bad samples · openclaw/o...
vincentkoc · 2026-05-27 · via Recent Commits to openclaw:main

@@ -2,6 +2,7 @@ import { spawn } from "node:child_process";

22

import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";

33

import os from "node:os";

44

import path from "node:path";

5+

import { pathToFileURL } from "node:url";

5667

type CommandCase = {

78

id: string;

@@ -394,6 +395,17 @@ function parseRepeatableFlag(flag: string): string[] {

394395

}

395396396397

function parsePositiveInt(raw: string | undefined, fallback: number): number {

398+

if (!raw) {

399+

return fallback;

400+

}

401+

const parsed = Number.parseInt(raw, 10);

402+

if (!Number.isFinite(parsed) || parsed < 1) {

403+

return fallback;

404+

}

405+

return parsed;

406+

}

407+408+

function parseNonNegativeInt(raw: string | undefined, fallback: number): number {

397409

if (!raw) {

398410

return fallback;

399411

}

@@ -747,6 +759,25 @@ function printDelta(primary: SuiteResult, secondary: SuiteResult): void {

747759

}

748760

}

749761762+

export function collectFailedSamples(result: SuiteResult): string[] {

763+

const failures: string[] = [];

764+

for (const commandCase of result.cases) {

765+

if (commandCase.samples.length === 0) {

766+

failures.push(`${result.entry} ${commandCase.id}: no measured samples`);

767+

continue;

768+

}

769+

for (const [sampleIndex, sample] of commandCase.samples.entries()) {

770+

const label = `${result.entry} ${commandCase.id} sample ${sampleIndex + 1}`;

771+

if (sample.signal !== null) {

772+

failures.push(`${label}: exited via signal ${sample.signal}`);

773+

} else if (sample.exitCode !== 0) {

774+

failures.push(`${label}: exited with code ${String(sample.exitCode)}`);

775+

}

776+

}

777+

}

778+

return failures;

779+

}

780+750781

async function buildSuiteResult(params: {

751782

entry: string;

752783

options: CliOptions;

@@ -796,7 +827,7 @@ function parseOptions(): CliOptions {

796827

entryPrimary: parseFlagValue("--entry-primary") ?? parseFlagValue("--entry") ?? DEFAULT_ENTRY,

797828

entrySecondary: parseFlagValue("--entry-secondary"),

798829

runs: parsePositiveInt(parseFlagValue("--runs"), DEFAULT_RUNS),

799-

warmup: parsePositiveInt(parseFlagValue("--warmup"), DEFAULT_WARMUP),

830+

warmup: parseNonNegativeInt(parseFlagValue("--warmup"), DEFAULT_WARMUP),

800831

timeoutMs: parsePositiveInt(parseFlagValue("--timeout-ms"), DEFAULT_TIMEOUT_MS),

801832

json: hasFlag("--json"),

802833

output: parseFlagValue("--output"),

@@ -864,6 +895,10 @@ async function main(): Promise<void> {

864895

primary,

865896

secondary: secondary ?? null,

866897

};

898+

const failures = [

899+

...collectFailedSamples(primary),

900+

...(secondary ? collectFailedSamples(secondary) : []),

901+

];

867902868903

if (options.output) {

869904

mkdirSync(path.dirname(options.output), { recursive: true });

@@ -872,6 +907,12 @@ async function main(): Promise<void> {

872907873908

if (options.json) {

874909

console.log(JSON.stringify(report, null, 2));

910+

if (failures.length > 0) {

911+

process.exitCode = 1;

912+

for (const failure of failures) {

913+

console.error(`[startup-bench] ${failure}`);

914+

}

915+

}

875916

return;

876917

}

877918

@@ -894,9 +935,28 @@ async function main(): Promise<void> {

894935

printSuite(secondary);

895936

printDelta(primary, secondary);

896937

}

938+939+

if (failures.length > 0) {

940+

process.exitCode = 1;

941+

console.error("\nFailed startup benchmark samples:");

942+

for (const failure of failures) {

943+

console.error(`- ${failure}`);

944+

}

945+

}

897946

} finally {

898947

rmSync(tmpDir, { recursive: true, force: true });

899948

}

900949

}

901950902-

await main();

951+

export const testing = {

952+

collectFailedSamples,

953+

parseNonNegativeInt,

954+

parsePositiveInt,

955+

};

956+957+

if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {

958+

await main().catch((error: unknown) => {

959+

console.error(error instanceof Error ? error.stack : String(error));

960+

process.exit(1);

961+

});

962+

}