test(metrics): derive oversized fixture from scan cap

Export the internal scan budget for regression tests and size the oversized-line fixture as exactly two bounded passes.
This commit is contained in:
wellkilo
2026-09-13 05:14:26 +08:00
parent e9302928d0
commit 76329557c4
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -500,6 +500,7 @@ module.exports = {
COST_SNAPSHOT_SCHEMA_VERSION,
COST_SNAPSHOT_DIRECTORY,
COST_LOG_FILENAME,
MAX_SCAN_BYTES,
getCostSnapshotPath,
isValidCostRow,
chooseNewerCumulativeRow,
+2 -1
View File
@@ -8,6 +8,7 @@ const path = require('path');
const {
appendSessionCostRow,
getCostSnapshotPath,
MAX_SCAN_BYTES,
maybePruneSessionCostSnapshots,
readSessionCostSnapshot,
refreshSessionCostSnapshot,
@@ -199,7 +200,7 @@ try {
if (test('bounds oversized unterminated rows and caches the discarded prefix', () => {
const caseRoot = path.join(root, 'oversized-line');
fs.mkdirSync(caseRoot, { recursive: true });
const oversizedBytes = 32 * 1024 * 1024;
const oversizedBytes = 2 * MAX_SCAN_BYTES;
fs.writeFileSync(
path.join(caseRoot, 'costs.jsonl'),
Buffer.alloc(oversizedBytes, 0x78)