Commit 95a5e1f
committed
test(osgen): pin perOpErrorTypeName <-> errwrap.OperationWrappers coupling
perOpErrorTypeName's hardcoded switch and errwrap.OperationWrappers'
wrapper-count map are coupled by an unstated invariant: a group has a
per-op aggregator type iff its catalog entry declares 2+ wrappers. Today
both sides match, but nothing checks them, so a future catalog edit can
desync the two without any signal -- the dispatch keeps referencing a
per-op type that's no longer reachable, or worse, emits an empty type
name when a 2+-wrapper group lacks a switch arm.
Add a coupling test that asserts both directions:
- every group naming a per-op aggregator type has 2+ wrappers in
OperationWrappers
- every catalog entry with 2+ wrappers has a non-empty per-op
aggregator type
Iterates the catalog directly rather than a duplicate list of switch
arms, so a new switch arm or catalog entry is exercised automatically.
Failure messages are actionable: they name the offending group, the
current state, and the remediation (add wrappers, remove switch arm,
or add a hand-written aggregator).
Ref: opensearch-project#844 (review round 3, F7)
Signed-off-by: Sean Chittenden <sean.chittenden@crowdstrike.com>1 parent f95f305 commit 95a5e1f
2 files changed
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 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 | + | |
309 | 355 | | |
310 | 356 | | |
311 | 357 | | |
| |||
0 commit comments