Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

test(rigor): allow explicit resume CPU profiling [C7,D1]

Corey Olson2465cbbc2480
diff --git a/test/query-plans.test.js b/test/query-plans.test.js
index fe2d3364..d0def5e8 100644
--- a/test/query-plans.test.js
+++ b/test/query-plans.test.js
@@ -47,6 +47,21 @@ function fixture() {
import { appendFileSync } from 'node:fs';
import childProcess from 'node:child_process';
import { syncBuiltinESMExports } from 'node:module';
+// Explicit development profiling preserves the normal command and timing assertion unchanged.
+if (process.env.PULLBOARD_RESUME_CPU_PROFILE) {
+ const { Session } = await import('node:inspector');
+ const { writeFileSync } = await import('node:fs');
+ const session = new Session();
+ session.connect();
+ const post = method => new Promise((resolve, reject) => session.post(method, (error, result) => error ? reject(error) : resolve(result)));
+ await post('Profiler.enable');
+ await post('Profiler.start');
+ process.once('beforeExit', async () => {
+ const { profile } = await post('Profiler.stop');
+ writeFileSync(process.env.PULLBOARD_RESUME_CPU_PROFILE + '.' + process.pid + '.cpuprofile', JSON.stringify(profile));
+ session.disconnect();
+ });
+}
let gitDepth = 0;
for (const name of ['spawnSync', 'execFileSync']) {
const original = childProcess[name];