Repository navigation
Conversation
Six assertions in five native parser tests bounded elapsed time (1 to 10 s). They depend on host speed and can fail on loaded CI shards without a regression. Four are replaced or removed: - Near-maximal ELF section table (initializers): count section-table element reads through a test-local pass-through of readElfDirectoryFromBuffer. Reading the image reads each of the 65,535 headers six times; the test allows 16. Walking the headers to name each slot's target reads them once per slot and stops at the allowance. - Largest PE section table (load config): the same count over the readPeImage section table. Indexing names reads each section twice; the test allows 4. A per-callback scan reads them 4,096 more times. - Huge declared DT_INIT_ARRAYSZ: deleted. The test already pins examined_entries to the slot budget and the budget limitation. Scanning the declared 2^50 slots never returns, so the elapsed check was never reached. - Shared huge __ksymtab name: deleted. The test already pins the exact examined count, null names with their reason and a 2 MiB report bound. Decoding the shared name per section exceeds the section directory's 16 MiB name budget. Two bounds stay because no counter observes their regression: - BinaryHardeningParsers, hostile section table (5 s): rescanning the admitted note tables per candidate works on spans copied out of the section headers, so no parser counter, limit or test-visible read changes. - ElfNoteParser, GNU gold version (1 s): a backtracking trailing-NUL regex leaves the text budget charges unchanged. Validation: each regression was reintroduced in the parser (uncommitted) and run against the base test file and the new one where it changed. - Header walk per initializer lookup: base failed after 64,207 ms (10,000 ms bound); new failed in about 1 s at the read allowance. - Section scan per PE callback: base failed at 3,775 ms (1,000 ms bound); new failed at the read allowance. - Unclamped DT_INIT_ARRAYSZ scan: the base test did not finish in 90 s (not rerun on the new file, which only drops lines after the read). - Shared name decoded per section: base and new failed with BinaryResourceFailure (16 MiB name budget). Over-long names listed: base and new failed the report schema. - Kept bounds: rescanning admitted note tables failed at 14,009 ms (5,000 ms); a regex NUL trim failed at 9,106 ms (1,000 ms). test:local on the five files: 353 passed. check:fast: passed. Refs morluto#10513
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Low impact] The test-only changes appear safe to merge. SummaryReplaces two native-parser timing assertions with test-local section-read allowances and removes two timing assertions while keeping existing budget and output checks.
Reviews (2) · Last reviewed commit: "test(native): format the moved section d..." · Reviewed by Greptile |
Main moved ArtifactReader to src/resources and readPeImage and readElfDirectoryFromBuffer to src/domain/native. The work-count tests mock those readers, and a mock of a path that no longer exists intercepts nothing, so their read budgets would pass without counting. The mocks now name the new modules; each test fails again when its budget is cut to one read.
Summary
Refs #10513. This slice covers native parsers. It complements #10619, #10627 and the JavaScript-lifetime slice. It replaces or deletes 4 of the 6 wall-clock bounds in
src/native/**tests and changes no production code.Change and scope
NativeInitializersParsers.test.ts, near-maximal section table: the 10 s bound becomes a count of ELF section-table reads through a test-local pass-through ofreadElfDirectoryFromBuffer. The test measured 6 reads per header and allows 16; a read beyond the limit throws.NativeInitializersParsers.test.ts, hugeDT_INIT_ARRAYSZ: the bound is deleted, because the test already asserts the slot budget.PeLoadConfigParser.test.ts: the same read count over thereadPeImagesection table. The test measured 2 reads per section and allows 4.KernelModuleParser.test.ts: the bound is deleted, because the test already asserts exact counts and a 2 MiB report bound.BinaryHardeningParsersbound (5 s) and theElfNoteParsergold-version bound (1 s). Their regressions do not change any parser counter (14 s and 9.1 s when reintroduced), so no deterministic measure fits without a production counter.Evidence and regression coverage
Each regression was reintroduced in an uncommitted change:
Validation performed
npm run test:localon the 5 native test files: 353 passed.npm run check:fastpassed.oxfmt --checkpassed.Author readiness
Human owner: @Davmunrey
Before merge
type(scope): outcome.