Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Test that all three vendored driver copies carry the GST-2260 plan-generation heal

garrytan0d77ac9bc44e
diff --git a/test/stale-plan-heal.test.ts b/test/stale-plan-heal.test.ts
index b4ac6bcf2d..b7eff65749 100644
--- a/test/stale-plan-heal.test.ts
+++ b/test/stale-plan-heal.test.ts
@@ -17,6 +17,7 @@
*/
import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
import { randomUUID } from 'node:crypto';
+import { readFileSync } from 'node:fs';
import net from 'node:net';
import type { AddressInfo } from 'node:net';
import postgres from '#postgres';
@@ -54,6 +55,16 @@ describe('write admission and a stale plan that keeps coming back (GST-2260)', (
});
});
+describe('every vendored driver copy carries the plan-generation heal (GST-2260)', () => {
+ for (const path of ['vendor/postgres/src/connection.js', 'vendor/postgres/cjs/src/connection.js', 'vendor/postgres/cf/src/connection.js']) {
+ test(`${path} starts a new plan generation on a stale cached plan`, () => {
+ const source = readFileSync(new URL(`../${path}`, import.meta.url), 'utf8');
+ expect(source).toContain('let planGeneration = 0');
+ expect(source).toContain("errorResponse.routine === 'RevalidateCachedQuery' && planGeneration++");
+ });
+ }
+});
+
describe.skipIf(!url)('a prepared SELECT * after another connection changes its table (GST-2260)', () => {
let admin: ReturnType<typeof postgres>;
const engines: PostgresEngine[] = [];