Commit b9bf100
authored
Use random string for unknown exchange type tests (#204)
Previously, the tests passed `none` as the exchange type and asserted on the "invalid exchange type" error. That path only fires in `rabbit_exchange:check_type/1` when the type is a known atom whose module lookup fails — `none` happens to already be interned as an atom in the VM, so `binary_to_existing_atom/1` succeeds and the module lookup is what fails.
A random string exercises the other branch: `binary_to_existing_atom/1` returns `{error, not_found}` in `rabbit_registry:binary_to_type/1`, and the broker replies with "unknown exchange type '<name>'".
However, this breaks it for LavinMQ < 2.8.0 (not yet released) which uses another error message ("invalid exchange type") so temporarily broaden the regex to allow for both types of messages.1 parent 868de40 commit b9bf100
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
431 | 433 | | |
432 | 434 | | |
433 | 435 | | |
| |||
756 | 758 | | |
757 | 759 | | |
758 | 760 | | |
759 | | - | |
| 761 | + | |
| 762 | + | |
760 | 763 | | |
761 | | - | |
| 764 | + | |
| 765 | + | |
762 | 766 | | |
763 | 767 | | |
764 | 768 | | |
| |||
0 commit comments