Skip to content

Commit faa59e6

Browse files
Copilotmykaul
andcommitted
Improve test robustness based on code review feedback
- Remove assumption about query order in test - Use self.control_connection._schema_meta_page_size instead of hardcoded value - Make test more maintainable and resilient to changes Co-authored-by: mykaul <4655593+mykaul@users.noreply.github.com>
1 parent a79e51d commit faa59e6

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

tests/unit/test_control_connection.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -315,16 +315,13 @@ def test_topology_queries_use_paging(self):
315315
# Verify that wait_for_responses was called
316316
assert self.connection.wait_for_responses.called
317317

318-
# Get the QueryMessage arguments
318+
# Get the QueryMessage arguments - both should be QueryMessage instances
319319
call_args = self.connection.wait_for_responses.call_args[0]
320-
peers_query = call_args[0]
321-
local_query = call_args[1]
322320

323-
# Verify that both queries have fetch_size set
324-
assert isinstance(peers_query, QueryMessage)
325-
assert isinstance(local_query, QueryMessage)
326-
assert peers_query.fetch_size == 1000 # default schema_meta_page_size
327-
assert local_query.fetch_size == 1000 # default schema_meta_page_size
321+
# Verify both arguments are QueryMessage instances with fetch_size set
322+
for query_msg in call_args:
323+
assert isinstance(query_msg, QueryMessage)
324+
assert query_msg.fetch_size == self.control_connection._schema_meta_page_size
328325

329326
def test_refresh_nodes_and_tokens_with_invalid_peers(self):
330327
def refresh_and_validate_added_hosts():

0 commit comments

Comments
 (0)