Commit c7252e4
committed
(fix) test: Fix KeyError in test_idle_heartbeat with connection replacement
The test_idle_heartbeat test was failing with a KeyError when connections were dynamically replaced during the test run in shard-aware environments.
Root cause: The test captures connection object IDs at the start, sleeps for heartbeat intervals, then tries to validate those connections.
In shard-aware ScyllaDB deployments, the driver may replace connections during this window.
When a connection is replaced, the new connection object has a different Python ID, causing a KeyError on lookup.
Fix: Skip validation for connections that weren't present in the initial snapshot.
This preserves the test's intent (validating heartbeats on stable connections) while being robust to dynamic connection management in shard-aware mode.
I'm not sure this is a great fix. I don't think it has anything to do with this branch. I'll push it and if it's OK, I'll also create a separate PR for it.
Why it popped now?
Signed-off-by: Yaniv Kaul <yaniv.kaul@scylladb.com>1 parent 153c913 commit c7252e4
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
| 772 | + | |
| 773 | + | |
772 | 774 | | |
773 | | - | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
774 | 780 | | |
775 | 781 | | |
776 | 782 | | |
| |||
0 commit comments