Repository navigation
Conversation
start_server and the tags proc strip double quotes from the tags value
and use what is left as the tag list. That splits {"repl external:skip"}
into two tags, but [list "acl external:skip"] has the string form
{acl external:skip}, whose braces survive, so it stays one tag named
"acl external:skip". tags_acceptable never sees external:skip, the block
runs against the external server, and CONFIG SET of an immutable
override such as aclfile throws, killing the whole test client. The test
proc has the same problem for both forms, since it does not strip quotes
at all.
Flatten the parsed list one level in all three places, so {"a b"},
{a b}, [list a b] and [list "a b"] all yield the same two tags.
usercall.tcl tags its role block [list "modules usercall external:skip"],
which is a single tag today. It is now skipped on an external server as
intended.
Signed-off-by: Madelyn Olson <madelyneolson@gmail.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.
start_server {tags {"a b"}}gives two tags, butstart_server [list tags [list "a b"]]gives one tag nameda b. The parser only strips double quotes, and the braceslistadds survive. So a block tagged[list "x external:skip"]is not skipped on an external server, and CONFIG SET of an immutable override likeaclfilekills the whole test client. Thetagsandtestprocs have the same trap. This flattens the parsed list in all three, so every form gives the same tags.AI generated details
Problem
tests/support/server.tcl:526(start_server) andserver.tcl:311(tagsproc) doset tags [string map { \" "" } $value].{"repl external:skip"}becomesrepl external:skip, two elements.[list "acl external:skip"]has the string form{acl external:skip}, one element.tags_acceptable(server.tcl:249) doeslsearch -exact $tags external:skip, which misses it, sorun_external_server_test(server.tcl:420) applies every override with CONFIG SET.test(tests/support/test.tcl:282) takes its tags argument as a list with no processing, so both{"a b"}and[list "a b"]are one tag there.Seen on #243 in test-external-cluster (https://github.com/madolson/valkey/actions/runs/47453062514/job/145459502181):
The quote stripping dates from 677d14c ("test infra - improve test skipping ability").
Fix
concat {*}the result in all three places.{"a b"},{a b},[list a b]and[list "a b"]all givea b.Existing tags that change
One tag in the tree is a single multi-word tag today:
tests/unit/moduleapi/usercall.tcl:189,tags [list "modules usercall external:skip"](added in valkey-io#3967, first released in 9.2.0). It now becomes three tags, so the block is skipped on an external server and by--tags -modules/--tags -usercall. CI never runs moduleapi tests against an external server, so no CI job changes. Every othertags [list ...]intests/already uses one word per element.Alternative considered
Fixing the callers to use
{"x external:skip"}instead of[list ...]. That is what #243 did, and it leaves the next[list "a b"]to fail the same way. The block cannot use the brace form whenever the tags come from a variable.Testing
No test in the suite, since this is the test framework. Scratch file run against an external server (
./src/valkey-server --port 21111 --save "" --daemonize yes, then./runtest --host 127.0.0.1 --port 21111 --single unit/zz-repro):Base, first block:
Base, the rest with the first block removed:
With the fix:
./runtest --moduleapi --host 127.0.0.1 --port 21111 --single unit/moduleapi/usercallon base dies at the line 189 block withERR CONFIG SET failed (possibly related to argument 'dir') - can't set protected config. With the fix it is skipped.Filtering, base against fix, over every existing form (
{"network qb"},{network qb},[list network qb],"network",tags {"qa"},tags {qa qb}, test tag{qa qb}and{"qa"}) plus[list "network qb"], under no filter,--tags network,--tags -qb,--tags -qa,--tags -qcand--tags network --tags -qb. Output is identical except for the[list "network qb"]block: base drops it under--tags networkand runs it under--tags -qb; with the fix it runs under--tags networkand is denied under--tags -qb.This was generated by AI but verified, with love, by a human.