我有一个连接到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容器似乎没有速率限制设置。我想象当我有更多的测试异步运行时,这将成为一个问题。