test(retrieve): install rustls CryptoProvider in reranker tests#12
Open
doctatortot wants to merge 1 commit into
Open
test(retrieve): install rustls CryptoProvider in reranker tests#12doctatortot wants to merge 1 commit into
doctatortot wants to merge 1 commit into
Conversation
PR ourmem#6 installed a process-global rustls CryptoProvider in the api test setup_app() so the ~20 api tests stop panicking with "no process-level CryptoProvider available." That fix happened to also unblock the 3 retrieve::reranker tests that call reqwest::Client::new() — but only because api tests run before reranker tests in the same test binary, install the provider as a side effect, and the static Once is shared. Running `cargo test --lib retrieve::reranker::` in isolation still panics: no api test runs first, no provider is installed. That makes the green-CI claim from 3472c74 order-dependent. Mirror the PR ourmem#6 pattern here: own install_crypto_provider() helper guarded by its own Once, called at the top of each test that constructs a Reranker. Now `cargo test --lib retrieve::reranker::` passes 8/8 standalone. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
yhyyz
pushed a commit
that referenced
this pull request
May 20, 2026
`lance-encoding`'s build.rs invokes `protoc` to generate prost bindings. Without it `cargo clippy` and `cargo test` fail at compile time with "Could not find `protoc`. If `protoc` is installed, try setting the `PROTOC` environment variable..." This was masked previously because CI bailed at the `cargo fmt --check` step (229 sites of fmt drift across upstream main). After the fmt cleanup in 508e9e6, PRs now reach the clippy step and surface this dep. Three currently-open PRs (#11 #12 #14) hit this on their last CI runs. Adding `apt-get install protobuf-compiler` before the rust toolchain step matches the standard pattern for Rust projects with prost-build deps (see lancedb, datafusion, deltalake CI configs). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mirrors the PR #6 pattern for
retrieve::rerankertests. Adds an owninstall_crypto_provider()helper (guarded by its ownOnce) and calls it from the three reranker tests that construct areqwest::Client.Why
The
install_crypto_provider()from PR #6 lives inapi::tests::setup_app(). Because rustls's provider install is process-global and guarded byOnce, the reranker tests appear to pass undercargo test --lib— but only because the api tests happen to run first in the same test binary, install the provider, and the side effect persists.Run in isolation, the failure is immediate:
So the green-CI claim from 3472c74 is order-dependent — sound today, sound under
cargo test --lib, but breaks the moment anyone scopes the test run or cargo's scheduler changes.After this PR
The helper is intentionally a copy rather than a shared utility — two separate
Onceguards in two test modules is safe (both callinstall_default(), which itself returnsErrafter the first call; we ignore that). Promoting it to a sharedmod test_utilis fine if you'd prefer; happy to revise.🤖 Generated with Claude Code