fix: 非阻塞回退 Workbench API 调优配置
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user