(fix) test: Fix KeyError in test_idle_heartbeat with connection repla…#762
Draft
mykaul wants to merge 2 commits intoscylladb:masterfrom
Draft
(fix) test: Fix KeyError in test_idle_heartbeat with connection repla…#762mykaul wants to merge 2 commits intoscylladb:masterfrom
mykaul wants to merge 2 commits intoscylladb:masterfrom
Conversation
…cement 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>
Author
|
CI flakiness - unrelated, will send a separate PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…cement
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?
Pre-review checklist
./docs/source/.Fixes:annotations to PR description.