MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / growFile

Function growFile

__tests__/liveness-watchdog.test.ts:128–133  ·  view source on GitHub ↗

Grow `file` every 150ms for `forMs`; resolves when done.

(file: string, forMs: number)

Source from the content-addressed store, hash-verified

126
127 /** Grow `file` every 150ms for `forMs`; resolves when done. */
128 function growFile(file: string, forMs: number): Promise<void> {
129 return new Promise((resolve) => {
130 const iv = setInterval(() => { fs.appendFileSync(file, 'x'.repeat(64)); }, 150);
131 setTimeout(() => { clearInterval(iv); resolve(); }, forMs);
132 });
133 }
134
135 it('does NOT kill a blocked loop while the watched files advance (slow store, not a wedge)', async () => {
136 const tmp = path.join(fs.mkdtempSync(path.join(require('os').tmpdir(), 'cg-wd-')), 'db-wal');

Callers 1

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected