Repository navigation
Conversation
The ACL tests now read the role lists from docs/redis.md, and a unit test checks that each role's scripts call exactly those commands. So a script that calls a new command fails until the docs list it.
A cluster refuses a script with CROSSSLOT when a key falls outside the hash tag. The ids take the characters that a tag or a key uses.
…rror A user with no INFO gets past connect, and then each key of another node gets MOVED. The case checks a write, a read and a blocking read.
Each seed runs the same random calls on both Stores and compares the answers. A refused write must also leave the Stream's Redis keys as they were, since Redis doesn't roll a script back.
A retry run's creates and appends withdraw the previous run, and Local Activities of three Workflow Tasks give random task facts. These rules are the longest part of the append script.
Collaborator
Author
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.
What changed?
This PR adds tests that act as a harness for later changes to the Redis Store. A change that breaks a rule of the Store fails one of them before review.
tests/parity.rsruns the same seeded random calls on the memory Store and the Redis Store, and compares the answers. The calls cover creates, appends, closes, reads, reverse reads, retry-run withdrawals and Local Activity task facts. A refused write must also leave the Stream's Redis keys as they were. A failure prints its seed and its last calls, andSTREAMS_PARITY_SEED=<seed>replays it.docs/redis.mdis now the only list of each role's commands.tests/acl.rsreads it, and a unit test checks that each role's scripts call exactly those commands. Another unit test checks that the docs' load command gives the read scripts' exact bytes.+info, gets a config error.Why?
Agents will make more of the changes to this crate. These tests check the rules that a reviewer would otherwise check by hand. Both Stores agree, a refusal writes nothing, and the docs match the scripts.
I checked each test against a deliberate bug, and each bug failed its test. The bugs were a script write before a refusal, a wrong resend answer, a read with one entry too many, a missing orphan item, a missing run fence, a command that the docs don't list, and a
MOVEDmapping that does nothing. A long parity run on standalone Redis and on a cluster found no difference between the Stores.How did you test it?
crates/streams-redis/scripts/redis-test-servers.sh STREAMS_PARITY_SEEDS=3000 cargo test -p temporalio-streams-redis --test parity -- --include-ignored