mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-04 14:03:06 +00:00
alternator-test: migrate filled_test_table to use batches
Filled test table fixture now takes advantage of batch writes in order to run faster. Message-Id: <e299cdffa9131d36465481ca3246199502d65e0c.1557914382.git.sarna@scylladb.com>
This commit is contained in:
committed by
Nadav Har'El
parent
4c3bdd3021
commit
f3440f2e4a
@@ -135,9 +135,9 @@ def filled_test_table(dynamodb):
|
||||
'another': "y" * 16
|
||||
} for i in range(count)]
|
||||
|
||||
for item in items:
|
||||
# TODO: eventually, when Alternator supports batch operations,
|
||||
# use a batch write to make this fixture start faster.
|
||||
table.put_item(Item=item)
|
||||
with table.batch_writer() as batch:
|
||||
for item in items:
|
||||
batch.put_item(item)
|
||||
|
||||
yield table, items
|
||||
table.delete()
|
||||
|
||||
@@ -47,7 +47,6 @@ def test_basic_batch_write_item(dynamodb, test_table):
|
||||
|
||||
for i in range(count):
|
||||
item = test_table.get_item(Key={'p': "batch{}".format(i), 'c': "batch_ck{}".format(i)}, ConsistentRead=True)['Item']
|
||||
print(item)
|
||||
assert item['p'] == "batch{}".format(i)
|
||||
assert item['c'] == "batch_ck{}".format(i)
|
||||
assert item['attribute'] == str(i)
|
||||
|
||||
Reference in New Issue
Block a user