Skip to content

test: bump recursion_limit on 7 CRUD test files for SURREAL_TEST_KV=lance compat#5

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/phase-2-wider-test-suite
May 16, 2026
Merged

test: bump recursion_limit on 7 CRUD test files for SURREAL_TEST_KV=lance compat#5
AdaWorldAPI merged 1 commit into
mainfrom
claude/phase-2-wider-test-suite

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

Summary

Mechanical follow-up to #1's Sprint O: adds #[recursion_limit = "1024"] to 7 more CRUD test files so the upstream integration suite can be exercised against the kv-lance backend via SURREAL_TEST_KV=lance.

Why

When both kv-lance and kv-mem features are enabled (the combination is needed because helpers.rs::new_ds() routes through SURREAL_TEST_KV=lance from #1, and upstream iam/file.rs requires tempfile which is gated to kv-mem), the async-trait expansion in surrealdb_core::expr::expression::Expr::compute exceeds rustc's default recursion limit of 128.

Same pattern, same fix:

error: queries overflow the depth limit!
  help: consider increasing the recursion limit by adding a
        `#[recursion_limit = "256"]` attribute to your crate
  note: query depth increased by 130 when computing layout of
        {async fn body of surrealdb_core::expr::expression::Expr::compute()}

Files

7 inner attributes added:

File Position
surrealdb/core/tests/select.rs before mod helpers;
surrealdb/core/tests/update.rs after #[allow(clippy::unwrap_used)]
surrealdb/core/tests/delete.rs after #[allow(clippy::unwrap_used)]
surrealdb/core/tests/insert.rs after #[allow(clippy::unwrap_used)]
surrealdb/core/tests/upsert.rs after #[allow(clippy::unwrap_used)]
surrealdb/core/tests/merge.rs before mod helpers;
surrealdb/core/tests/relate.rs before mod helpers;

Value matches tests/create.rs (1024, set in #1's Sprint O).

Cost

Zero runtime cost. Pure compile-time directive; only loosens a default limit.

Test plan

  • CI default test run unchanged (no feature change).
  • CI/local run of SURREAL_TEST_KV=lance cargo test --features "kv-lance kv-mem" --no-default-features --test update (and select/delete/insert/upsert/merge/relate) compiles without recursion errors. Pass-rate signal feeds the next sprint's KNOWN_DIFFERENCES.md update.

What's NOT covered

  • Behavioral pass/fail on the test bodies themselves — that's the Meta phase, will be summarized as a follow-up comment on this PR once the runs complete.
  • The other 23 tests/*.rs files (access, alter, asyncevent, auth_limit, cache, changefeeds, complex, define, field, function, future, index, info, live, param, query, remove, script, sequence, table, timeout, util, ...) — they may or may not hit the recursion limit; addressed incrementally.

Generated by Claude Code

…ce compat

Same compile-time fix as Sprint O (tests/create.rs): when both
kv-lance and kv-mem features are enabled (needed for SURREAL_TEST_KV=lance
routing — upstream iam/file.rs uses tempfile which is kv-mem-gated),
the async-trait Expr::compute() expansion exceeds rustc's default
recursion limit of 128.

Adds #![recursion_limit = "1024"] (zero runtime cost) to the 7
representative CRUD test files so the upstream integration suite
can be exercised against kv-lance:

- select.rs
- update.rs
- delete.rs
- insert.rs
- upsert.rs
- merge.rs
- relate.rs

Matches the value already in tests/create.rs from Sprint O. Each is
either before `mod helpers;` or after the existing
`#![allow(clippy::unwrap_used)]` to stay near the other inner
attributes.
@AdaWorldAPI AdaWorldAPI marked this pull request as ready for review May 16, 2026 01:35
@AdaWorldAPI AdaWorldAPI merged commit 78922f1 into main May 16, 2026
Copy link
Copy Markdown
Owner Author

Meta-S verification (post-merge follow-up)

SURREAL_TEST_KV=lance cargo test --features "kv-lance kv-mem" --no-default-features --test update
→ test result: ok. 2 passed; 0 failed; finished in 36.45s

Combined upstream integration coverage under SURREAL_TEST_KV=lance after this PR:

Test file Pass Source
tests/create.rs 3/3 Sprint O (#1)
tests/update.rs 2/2 this PR (Sprint S)

The remaining 5 files this PR enables (select, delete, insert, upsert, merge, relate) are queued for verification in a separate sprint along with the ~17 other tests/*.rs files. Each carries a small (~30-90s) per-test-binary cost because Lance creates real datasets on disk per #[tokio::test].


Generated by Claude Code

AdaWorldAPI pushed a commit that referenced this pull request May 16, 2026
…mmit

Captures the maintainer's preflight requirement so future agent
sessions inherit it automatically via the BOOT.md ritual.

Iron rule:

  9. Preflight `cargo clippy` before every commit. Always run
     `cargo clippy -p <crate> --no-default-features
      --features "<set>" -- -D warnings`
     against the affected feature set before pushing. A green clippy
     is the floor, not the goal — fix every warning at the source,
     don't #[allow] it past unless the rationale is documented
     inline. CI is the second line of defense; preflight is the first.

Pairs with iron rule #5 (Tests before claims) — clippy is the
static side of the same discipline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants