Skip to content

fix: broken integration tests (46 failures → 0) - #111

Merged
kacy merged 3 commits into
mainfrom
fix/integration-tests
Feb 12, 2026
Merged

fix: broken integration tests (46 failures → 0)#111
kacy merged 3 commits into
mainfrom
fix/integration-tests

Conversation

@kacy

@kacy kacy commented Feb 12, 2026

Copy link
Copy Markdown
Owner

summary

fixes all 46 failing integration tests across three root causes:

  • rename test: keys "old"/"new" hashed to different shards, causing a cross-shard
    error. added a shards option to ServerOptions and run this test with a single shard.
  • proto tests (44 failures): the ember-server binary wasn't built with the protobuf
    feature, so --protobuf was an unrecognized flag and the server failed to start within
    5 seconds. added ember-server as a dependency of the integration test crate so its
    protobuf feature is activated when tests run with --features protobuf.
  • persistence tests (AOF/snapshot recovery): ahash::AHasher::default() uses
    per-process random seeds, so keys hashed to different shards across restarts. replaced
    with FNV-1a which is fully deterministic — keys now route to the same shard after restart,
    so AOF and snapshot recovery work correctly.

what was tested

full workspace test suite: 1023 tests pass, 0 failures

cargo test --workspace --features protobuf
  • 59 cluster, 113 integration, 68 protocol, 296 persistence, 43 server, 80 cli, 363 core
  • clippy clean

kacy added 3 commits February 12, 2026 15:39
the rename test used keys "old" and "new" which hash to different
shards, causing a cross-shard error. use a single shard for this
test since it's testing RENAME correctness, not cross-shard behavior.

also add shards option to ServerOptions so tests can control
shard count.
the proto integration tests spawn ember-server as a subprocess, but
the binary wasn't being built with the protobuf feature. add
ember-server as a dependency so its protobuf feature is activated
when tests are run with --features protobuf.
replace ahash (which uses per-process random seeds) with FNV-1a
for shard routing. this ensures keys hash to the same shard across
server restarts, which is required for correct AOF and snapshot
recovery.

without this fix, keys written to shard-0.aof could be routed to
shard-1 after restart, causing data to appear lost.
@kacy
kacy merged commit 80b8dd7 into main Feb 12, 2026
6 of 7 checks passed
@kacy
kacy deleted the fix/integration-tests branch February 12, 2026 20:49
kacy added a commit that referenced this pull request Feb 19, 2026
* fix: rename integration test uses single shard

the rename test used keys "old" and "new" which hash to different
shards, causing a cross-shard error. use a single shard for this
test since it's testing RENAME correctness, not cross-shard behavior.

also add shards option to ServerOptions so tests can control
shard count.

* fix: propagate protobuf feature to ember-server for integration tests

the proto integration tests spawn ember-server as a subprocess, but
the binary wasn't being built with the protobuf feature. add
ember-server as a dependency so its protobuf feature is activated
when tests are run with --features protobuf.

* fix: use deterministic hash for shard routing

replace ahash (which uses per-process random seeds) with FNV-1a
for shard routing. this ensures keys hash to the same shard across
server restarts, which is required for correct AOF and snapshot
recovery.

without this fix, keys written to shard-0.aof could be routed to
shard-1 after restart, causing data to appear lost.
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.

1 participant