From a01aa94b3dd0618588b8d91c6e4d63b29ffb088a Mon Sep 17 00:00:00 2001 From: quolu <226230081+quolu@users.noreply.github.com> Date: Sat, 3 Oct 2026 05:49:53 +0000 Subject: [PATCH] =?UTF-8?q?oversize=E8=A9=A6=E9=A8=93=E3=81=AE=E8=A9=B0?= =?UTF-8?q?=E3=82=81=E7=89=A9=E3=82=92=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E8=A1=8C=E3=81=AB=E3=81=97=E3=80=8190=E7=A7=92=E3=81=AE?= =?UTF-8?q?=E6=99=82=E9=96=93=E5=BB=B6=E9=95=B7=E3=82=92=E5=A4=96=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 工場Windows機で `oversize-file-not-read` が90秒で時間切れになった(main 11fbd311、run 37100384189)。 同じtreeはPR #6のWindowsで成功している。 foxで実測した。書いた直後の1.4MBの `.js` を最初に読む時、中身が `const x = 1;` の約10万行だと 37〜42秒かかる(機械が空いている状態。同じ中身の `.txt`・`.ts`・`.mjs` は1〜2ms)。 Defenderのリアルタイム保護が `.js` を開く時に中身を解析している。同じ `.js` でも中身が コメント行なら24msで済む。 試験が確かめるのは「index上限を超え、viewerの8MB上限に収まる普通のtext」の扱いで、 文の中身には依らない。詰め物をコメント行に変え、9月30日に入れた90秒の延長を外す。 Co-Authored-By: Claude Opus 5.5 --- sensor/__tests__/oversize-file-not-read.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sensor/__tests__/oversize-file-not-read.test.ts b/sensor/__tests__/oversize-file-not-read.test.ts index 32a00246..6a1e186d 100644 --- a/sensor/__tests__/oversize-file-not-read.test.ts +++ b/sensor/__tests__/oversize-file-not-read.test.ts @@ -89,7 +89,10 @@ describe('an unchanged file over the size limit is not reported as drifted (#191 dir = fs.mkdtempSync(path.join(os.tmpdir(), 'lattice-sensor-oversize-drift-')); fs.writeFileSync(path.join(dir, 'app.ts'), 'export function alpha() { return 1; }\n'); // 1.4 MB of ordinary text: over the index limit, under the viewer's 8 MB read cap. - const line = 'const x = 1;\n'; + // Comment lines, not statements: Windows Defender parses a freshly written .js + // on first open, and 100k `const x = 1;` statements cost it 37-42 s on the idle + // factory runner (over 90 s under CI load); the same bytes as comments cost 24 ms. + const line = '// filler line\n'; fs.writeFileSync(path.join(dir, 'big.js'), line.repeat(Math.ceil((1.4 * 1024 * 1024) / line.length))); const cg = await LatticeSensor.init(dir, { index: true }); try { @@ -113,8 +116,5 @@ describe('an unchanged file over the size limit is not reported as drifted (#191 } finally { cg.close(); } - // The Windows factory runner's first read of this freshly written 1.4 MB .js - // takes ~34 s (measured 2026-09-30: statSync 0 ms, first readFileSync 34,152 ms, - // a second read 1 ms — scan-on-first-open, not this code). Room for that. - }, 90_000); + }); });