Commit 55731ff
committed
admin: cover forwarded ErrTablesNotLeader race-window (Claude review)
forwardErrorResponse already maps ErrTablesNotLeader to 503
leader_unavailable for the case where the leader passes its
isVerifiedDynamoLeader guard but then drops leadership mid-
Dispatch — the comment at forward_server.go:248 documents the
race. No test exercised that path though, which Claude's review
on PR #635 called out as a gap.
Add two tests that pin both the create and delete sides:
TestForwardServer_CreateTable_LeaderSteppedDownReturns503 and
TestForwardServer_DeleteTable_LeaderSteppedDownReturns503. Both
inject ErrTablesNotLeader through the stub source and assert
503 + leader_unavailable in the response body.
These are pure stub-driven unit tests so they run alongside the
existing 17 forward-server cases without spinning up a real
Raft cluster.1 parent a5a8650 commit 55731ff
1 file changed
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
317 | 357 | | |
318 | 358 | | |
319 | 359 | | |
| |||
0 commit comments