Commit 9cc105c
committed
tests: add unit tests for wait_for_schema_agreement with closed connection
Add two unit tests to ControlConnectionTest that cover the bug fixed in
the previous commit (#604):
test_wait_for_schema_agreement_recovers_from_closed_control_connection:
Simulates a node being stopped while wait_for_schema_agreement() is
running in control-connection mode (no explicit connection passed).
The mock initial connection raises ConnectionShutdown on its first
query and simultaneously installs a replacement connection, mirroring
what the driver's reconnect logic does in production.
Before the fix this exception propagated to the caller.
After the fix the function transparently picks up the new control
connection and returns True.
test_wait_for_schema_agreement_explicit_connection_raises_on_shutdown:
Guards the DDL code path, where the caller passes an explicit
connection to ensure schema agreement is verified through the DDL
coordinator. In this case ConnectionShutdown must still be re-raised
— there is no safe fallback to a different node.
This test passes both before and after the fix, confirming that the
fix does not weaken the explicit-connection path.
Signed-off-by: Nadav Har'El <nyh@scylladb.com>1 parent dd3cd52 commit 9cc105c
1 file changed
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
623 | 624 | | |
624 | 625 | | |
625 | 626 | | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
626 | 669 | | |
627 | 670 | | |
628 | 671 | | |
| |||
0 commit comments