Repository navigation
Commit a1673ea
authored
* Close the test-suite gaps from #3234
Four separate things, all small, none of which the suite could tell us about
because each was either hidden behind a gate or only visible as a flake.
**LatencyTests could not run at all.** GetHistory and GetLatest issue
`server.Execute("debug", "sleep", "0.5")`, and DEBUG is not in the exclusion
list in Message.RequiresDatabase - so it requires a database, while
IServer.Execute has none to give and refuses outright. Both tests failed
deterministically the moment RunLongRunning was set; nothing sets it, so nobody
noticed. Routed through IDatabase instead, which keeps the database and works.
There is only one endpoint in this configuration, so it still lands on the
server being measured.
Note this leaves a real limitation in place: IServer.Execute cannot issue any
command that RequiresDatabase says needs one, even where the subcommand plainly
does not - DEBUG SLEEP needs no database, DEBUG OBJECT does, and the command
token alone cannot tell them apart. Worth its own decision rather than a change
smuggled in here.
**UnroutableRedirect's remaining race.** The target is made unaddressable by
SetAnnouncedAddress *after* AddEmptyNode has already published it, leaving a
window where a topology refresh can see it still announcing an address, route
straight to it, and leave no redirect to test. Under RESP2 the subscription
connection completing can trigger exactly such a refresh. Added an
AddEmptyNode overload that fixes the announced address before publication, so
the node is never observable half-configured. An overload rather than an
optional parameter: StackExchange.Redis.Server is a shipped package.
This one matters more than a flake normally would: as the test's own comment
says, when the target becomes routable "every other test in this class silently
stops testing anything" - so it fails open, and a green run proved less than it
appeared to. 15/15 clean after.
**CountKeys was flaky by construction.** It flushed two dedicated databases
fire-and-forget on a connection it disposed immediately, then wrote and counted
on a different one; nothing ordered the flushes against the writes, so a loaded
run counted leftovers. Awaited instead. 10/10 clean.
**AGENTS.md described the test override wrongly** - as a gitignored
TestConfig.json. It is RedisTestConfig.json, it is tracked, and it is read as an
embedded resource, so editing it needs a rebuild and dirties the tree rather
than acting as a private override. Also documents RunLongRunning, since that is
what hides the gated tests above.
* Review: target the primary explicitly, and refuse a contradictory announced address
- LatencyTests now takes the server via GetAnyPrimary and sends DEBUG SLEEP with
DemandMaster, so both provably reach the same node. My previous comment said
there was only one endpoint; that is true of this configuration today - the
replica is not discovered as an endpoint, and GetEndPoints()[0] is the primary
- but resting on it was incidental, and this makes the guarantee explicit.
- AddEmptyNode's new overload threw away an explicit announced address for a
DnsEndPoint, because ApplyNameOnlyIdentity runs afterwards and forces Empty
for name-only identities. Refuse that combination instead of quietly doing
something else, and say so in the docs.
- Points at #3236 for the IServer.Execute limitation, which turns out to be a
v3 regression affecting far more than DEBUG.
1 parent b734861 commit a1673ea
5 files changed
Lines changed: 58 additions & 15 deletions
File tree
- tests/StackExchange.Redis.Tests
- toys/StackExchange.Redis.Server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
67 | | - | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
74 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 44 | + | |
47 | 45 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
302 | 322 | | |
303 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
304 | 332 | | |
| 333 | + | |
305 | 334 | | |
306 | 335 | | |
| 336 | + | |
| 337 | + | |
307 | 338 | | |
308 | 339 | | |
309 | 340 | | |
| |||
0 commit comments