mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-03 13:37:04 +00:00
test: test_tablets: materialize all rows from the result set
When paging, iterating twice over the result set is not possible, making the second loop noop.
This commit is contained in:
committed by
Avi Kivity
parent
1d0be495b6
commit
c39332710d
@@ -58,8 +58,8 @@ async def test_tablet_metadata_propagates_with_schema_changes_in_snapshot_mode(m
|
||||
await asyncio.gather(*[manager.cql.run_async(f"INSERT INTO test.test (pk, c) VALUES ({k}, 2);", execution_profile='whitelist')
|
||||
for k in keys])
|
||||
|
||||
rows = manager.cql.execute("SELECT * FROM test.test;")
|
||||
assert len(list(rows)) == len(keys)
|
||||
rows = manager.cql.execute("SELECT * FROM test.test;").all()
|
||||
assert len(rows) == len(keys)
|
||||
for r in rows:
|
||||
assert r.c == 2
|
||||
|
||||
@@ -73,8 +73,8 @@ async def test_tablet_metadata_propagates_with_schema_changes_in_snapshot_mode(m
|
||||
await asyncio.gather(*[manager.cql.run_async(f"INSERT INTO test.test (pk, c) VALUES ({k}, 3);", execution_profile='whitelist')
|
||||
for k in keys])
|
||||
|
||||
rows = manager.cql.execute("SELECT * FROM test.test;")
|
||||
assert len(list(rows)) == len(keys)
|
||||
rows = manager.cql.execute("SELECT * FROM test.test;").all()
|
||||
assert len(rows) == len(keys)
|
||||
for r in rows:
|
||||
assert r.c == 3
|
||||
|
||||
@@ -94,8 +94,8 @@ async def test_scans(manager: ManagerClient):
|
||||
rows = manager.cql.execute("SELECT count(*) FROM test.test;")
|
||||
assert rows.one().count == len(keys)
|
||||
|
||||
rows = manager.cql.execute("SELECT * FROM test.test;")
|
||||
assert len(list(rows)) == len(keys)
|
||||
rows = manager.cql.execute("SELECT * FROM test.test;").all()
|
||||
assert len(rows) == len(keys)
|
||||
for r in rows:
|
||||
assert r.c == r.pk
|
||||
|
||||
|
||||
Reference in New Issue
Block a user