Dead-Letter-Queue and Lambda: How to test?

I created a SNS Topic dead-letter-queue in the AWS Console and added the property:

onError: arn:aws:sns:#{AWS::Region}:#{AWS::AccountId}:dead-letter-queue

to my function_handler definition in serverless.yml

But how can i test if the DLQ works?
I changed my function_handler so that it times out because i added time.sleep(120)
But i see no DLQ message in the SNS-Topic.
If i manually write a message to the SNS-Topic in the AWS Console, my DLQ handler sees it immediately.

So how can i provoke a failure of my Lambda function to fire a DLQ message to the SNS-Topic?

  1. Make your Lambda fail
  2. Allow enough time for all of the retries to occur (and fail)

The DLQ isn’t used the first time a message fails. It’s only used once all of the retries are exhausted.

AWS Documentations says:
Any Lambda function invoked asynchronously is retried twice before the event is discarded.

I assume i cannot test the DLQ in this way, because both sls invoke and an http event are both synchronous calls!?

Correct. You need to invoke the Lambda asynchronously (via SNS for example). Typically it will attempt to deliver the message three times (the initial plus two retries) and then the message will be put onto the DLQ.