Skip to content

Expand integration test coverage - #92

Merged
nherson merged 1 commit into
mainfrom
integration-test-enhancements
Sep 24, 2026
Merged

nherson merged 1 commit into
mainfrom
integration-test-enhancements

Conversation

@nherson

@nherson nherson commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR expands integration coverage and removes the requirement for shared test services.
The suite adds 49 integration tests and retains all original tests.

The added integration tests are ported from Shopify/Dalli, after doing an analysis of the cases covered in that repo (Ruby memcached client) and determining the gap in coverage here.

src/ and Cargo.toml remain unchanged. This PR does not change library behavior or runtime dependency declarations.

Details

  • Each fixture owns the service processes that it starts. The fixture stops the processes after the test or a panic.
  • Tests use dynamic loopback ports and isolated Unix sockets. They can run in parallel without a shared cache.
  • The installer uses fixed versions of the test tools and checks their SHA-256 checksums.
  • Original assertions now check stored values and per-key outcomes. Oversized batch failures use fixed positions.
  • New tests cover payload integrity and expiration. Additional tests cover concurrent clients and CAS conflicts.
  • Pipeline tests check complete contents and refusal statuses. Network tests cover interrupted responses and explicit connection recovery.
  • CI discovers every integration target and runs ignored tests. TESTING.md contains the local execution instructions.

The reference environment uses these versions:

  • memcached 1.6.41
  • libevent 2.1.12
  • Toxiproxy 2.11.0

Checks

The complete suite passed on macOS ARM64 and Linux ARM64.
It contains 168 integration tests and 43 unit tests. The full run had no failed or ignored tests.
Five additional macOS runs passed with 16 test threads.

These commands passed:

  • ./scripts/test-integration.sh
  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --doc --all-features
  • cargo build --release --all-features
  • cargo build --release --all-features --examples
  • bash -n scripts/install-test-tools.sh scripts/test-integration.sh

The Linux checks used a local container.
Benchmarks did not run because the library code remains unchanged.

Current limits

This PR preserves the current client behavior. It does not fix these limits:

  • Populated key dumps do not parse the current memcached metadata format. The new dump test covers an empty cache only.
  • A 1,000-key Unix meta read exceeded thirty seconds on macOS. The large-batch meta test uses TCP. Unix meta tests use smaller batches.
  • Malformed storage headers can leave extra error responses unread. The tests do not claim safe connection reuse after those headers.
  • memcached 1.6.41 accepts a 31-byte opaque payload but rejects 32 bytes. The tests preserve this server boundary without a client change.

@nherson nherson self-assigned this Sep 23, 2026
@nherson
nherson marked this pull request as ready for review September 23, 2026 15:54
@nherson
nherson requested a review from a team as a code owner September 23, 2026 15:54
@nherson
nherson merged commit 5ba5359 into main Sep 24, 2026
4 checks passed
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.

3 participants