DDB transaction limit increased to 100 (#5696)
This commit is contained in:
parent
4008011a7b
commit
d6c438400e
@ -229,7 +229,10 @@ class MultipleTransactionsException(MockValidationException):
|
||||
|
||||
|
||||
class TooManyTransactionsException(MockValidationException):
|
||||
msg = "Validation error at transactItems: Member must have length less than or equal to 25."
|
||||
msg = (
|
||||
"1 validation error detected at 'transactItems' failed to satisfy constraint: "
|
||||
"Member must have length less than or equal to 100."
|
||||
)
|
||||
|
||||
def __init__(self):
|
||||
super().__init__(self.msg)
|
||||
|
@ -1648,7 +1648,7 @@ class DynamoDBBackend(BaseBackend):
|
||||
return table.ttl
|
||||
|
||||
def transact_write_items(self, transact_items):
|
||||
if len(transact_items) > 25:
|
||||
if len(transact_items) > 100:
|
||||
raise TooManyTransactionsException()
|
||||
# Create a backup in case any of the transactions fail
|
||||
original_table_state = copy.deepcopy(self.tables)
|
||||
|
@ -555,12 +555,15 @@ def test_transact_write_items__too_many_transactions():
|
||||
with pytest.raises(ClientError) as exc:
|
||||
dynamodb.transact_write_items(
|
||||
TransactItems=[
|
||||
update_email_transact(f"test{idx}@moto.com") for idx in range(26)
|
||||
update_email_transact(f"test{idx}@moto.com") for idx in range(101)
|
||||
]
|
||||
)
|
||||
err = exc.value.response["Error"]
|
||||
err["Code"].should.equal("ValidationException")
|
||||
err["Message"].should.match("Member must have length less than or equal to 25")
|
||||
err["Message"].should.match(
|
||||
"1 validation error detected at 'transactItems' failed to satisfy constraint: "
|
||||
"Member must have length less than or equal to 100."
|
||||
)
|
||||
|
||||
|
||||
@mock_dynamodb
|
||||
|
Loading…
Reference in New Issue
Block a user