(dbPath: string, targetBytes: number)
| 57 | `; |
| 58 | |
| 59 | async function growWalThenSigkill(dbPath: string, targetBytes: number): Promise<void> { |
| 60 | const child = spawn(process.execPath, ['-e', WRITER_SOURCE, dbPath, String(targetBytes)], { |
| 61 | stdio: ['ignore', 'pipe', 'inherit'], |
| 62 | // Keep the child's cwd off the temp dir (Windows EPERM-on-cleanup quirk). |
| 63 | cwd: os.tmpdir(), |
| 64 | }); |
| 65 | await new Promise<void>((resolve, reject) => { |
| 66 | let out = ''; |
| 67 | child.stdout!.on('data', (d) => { |
| 68 | out += String(d); |
| 69 | if (out.includes('READY')) resolve(); |
| 70 | }); |
| 71 | child.on('exit', (code) => reject(new Error(`writer exited early (code ${code})`))); |
| 72 | setTimeout(() => reject(new Error('timed out growing the WAL')), 90_000); |
| 73 | }); |
| 74 | child.kill('SIGKILL'); |
| 75 | await new Promise((r) => child.on('exit', r)); |
| 76 | } |
| 77 | |
| 78 | describe('WAL heal after killed sessions (#1431)', () => { |
| 79 | let dir: string; |
no test coverage detected