You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SQS: purge_queue never raises PurgeQueueInProgress within the 60 second window #10233
SQS purge_queue never raises PurgeQueueInProgress. Real SQS allows only one PurgeQueue operation per queue every 60 seconds; a second call inside that window fails with error code AWS.SimpleQueueService.PurgeQueueInProgress. Moto happily purges any number of times, so code that handles (or tests for) the purge cooldown behaves differently against moto than against AWS.
The 60 second rule is in the PurgeQueue API reference ("Only one PurgeQueue operation is allowed every 60 seconds"), and the botocore service model declares the PurgeQueueInProgress error shape on the operation: "Indicates that the specified queue previously received a PurgeQueue request within the last 60 seconds (the time it can take to delete the messages in the queue)." https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_PurgeQueue.html
Against real AWS the second call raises ClientError with code AWS.SimpleQueueService.PurgeQueueInProgress and message Only one PurgeQueue operation on t1 is allowed every 60 seconds.; against moto it prints second purge succeeded.
I have a fix ready (track the last purge time on the queue and raise the documented error inside the window) and will open a PR. One note for the discussion: this makes moto stricter, so a user test suite that purges the same queue repeatedly without mocking time would start seeing the same error real AWS gives; happy to gate it behind a setting instead if you prefer.
Activity