绕过本地dockerized dynamodb的AWS速率限制

时间:2018-12-04 00:22:24

标签: amazon-web-services docker amazon-dynamodb rate-limiting

我有一个连接到dockerized dynamodb的测试套件。

// Start container with:
// docker run --name dynamodb -p 9000:8000 amazon/dynamodb-local

const mockConfig = {
    endpoint: 'http://localhost:9000',
    accessKeyId: 'mockAccessKeyId',
    secretAccessKey: 'mockSecretAccessKey',
    region: 'mockRegion',
    apiVersion: '2012-08-10',
}
const documentClient = new DynamoDB.DocumentClient(mockConfig)
...
test('Foo query', async () => {
    const x = await documentClient.query({...}).promise()
    expect(x).toEqual({...})
})

哪个工作正常。问题是当我连续太快地运行测试时,出现此错误:

{
    "error": "Too Many Requests",
    "message": "You have died of dysentery. Oregon Trail",
    "status": 429,
}

是否有任何方法可以防止本地限制此速率? docker容器似乎没有速率限制设置。我想象当我有更多的测试异步运行时,这将成为一个问题。

0 个答案:

没有答案