fix: 非阻塞回退 Workbench API 调优配置

This commit is contained in:
root
2026-07-19 20:12:01 +02:00
parent dc782ad316
commit 7d0299f89a
3 changed files with 17 additions and 5 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import { externalPostgresConfigForLane, externalPostgresManifest, opencodeEgress
import { CLOUD_CORE_MIGRATIONS, CLOUD_TRANSACTIONAL_REALTIME_MIGRATION_ID } from "../internal/db/schema.ts";
test("v03 Workbench API declares its required Bun idle timeout in owning YAML", async () => {
test("v03 Workbench API declares its preferred Bun idle timeout in owning YAML", async () => {
const deploy = parseYaml(await readFile("deploy/deploy.yaml", "utf8"));
const service = deploy.lanes.v03.services.find((item: { serviceId?: string }) => item.serviceId === "hwlab-workbench-api");
assert.ok(service, "missing v03 hwlab-workbench-api service declaration");
+4 -2
View File
@@ -20,8 +20,7 @@ try {
const nativeEnv = {
...process.env,
WORKBENCH_MODE: "native-test",
WORKBENCH_NATIVE_STATE_FILE: path.join(stateDir, "state.json"),
WORKBENCH_API_IDLE_TIMEOUT_SECONDS: "60"
WORKBENCH_NATIVE_STATE_FILE: path.join(stateDir, "state.json")
};
const api = start(["bun", "cmd/hwlab-workbench-api/main.ts"], {
...nativeEnv,
@@ -30,6 +29,9 @@ try {
}, "api");
children.push(api);
await waitFor(`${apiUrl}/health/ready`);
if (!logs.some((item) => item.service === "api" && item.stream === "stderr" && item.line.includes('"code":"workbench_api_idle_timeout_defaulted"') && item.line.includes('"blocking":false'))) {
throw new Error("missing non-blocking idle timeout fallback warning");
}
const web = start(["bun", "run", "workbench:web:dev"], { ...process.env, WORKBENCH_WEB_PORT: String(webPort) }, "web");
children.push(web);