test: extend max-depth stress coverage (#140)#146
Conversation
Add deterministic boundary tests that pin the named max-depth limits the fuzz_depth target only reaches probabilistically: - tests/ffi_depth_stress.rs: default max_depth=0 -> 1024 resolution at the FFI/parse level (accept 1024, reject 1025), the 4096 ceiling (accept 4096, reject 4097), clamp of over-ceiling requests (5000 / u32::MAX), object-only and mixed nesting boundaries (deterministic coverage was array-only elsewhere), a pathological 100k-deep input that must reject fast without recursing, and cursor reachability of an at-limit document. All cases run in both EAGER and LAZY modes. - tests/lua/options_spec.lua: propagate default-depth and clamped-ceiling nesting errors through the Lua wrapper without duplicating the existing accept/message/lazy/fractional cases. The deep stress case is a lightweight deterministic test in the standard CI gates; fuzz_depth continues to provide randomized exploration. EAGER/ LAZY depth equivalence is already fixed by #142 and is not re-covered.
|
Warning Review limit reached
More reviews will be available in 8 minutes and 3 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #140.
What
Adds deterministic max-depth boundary tests that pin the named limits the
fuzz_depthtarget only reaches probabilistically. As noted in the issue review, roughly 70% of the acceptance criteria were already covered (#142 mode relations,fuzz_depth,ffi_parse_error_offsets,options.rsunit tests,options_spec.lua), so this PR is scoped to the genuine deterministic gaps and does not re-cover EAGER/LAZY equivalence.tests/ffi_depth_stress.rs(new)max_depth = 0 -> 1024resolved at the FFI/parse level: accept 1024, reject 1025 with offset 10244096ceiling: accept 4096, reject 40974097,5000,u32::MAX) to 4096 — verifies the larger request is not honoredQJSON_NESTING_TOO_DEEPwithout recursingAll cases run in both EAGER and LAZY modes.
tests/lua/options_spec.luamax_depthto 4096 through the wrapperwithout duplicating the existing accept / message / lazy / fractional cases.
Stress placement
The deep stress case is a lightweight deterministic test running in the standard CI gates (
cargo test --releaseand--no-default-features);fuzz_depthcontinues to provide randomized exploration. No separate scheduled workflow is needed. EAGER/LAZY depth equivalence is already fixed by #142 and is intentionally not re-covered.Verification
cargo test --release— 168 + all integration tests passcargo test --release --no-default-features --test ffi_depth_stress— pass (scalar parity)cargo clippy --release --all-targets -- -D warnings— cleanoptions_spec.lua— 12/12 pass