Closed norbjd closed 8 months ago
The checks are marked as "failing" just because I had to cancel npmtest / test (containers, 20.x)
. After running it three times, thing is this one never finishes (logs):
Jest did not exit one second after the test run has completed.
'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with
--detectOpenHandles
to troubleshoot this issue.
It looks like an async operation is blocking stopping the test. I don't understand why it happens only one node 20. Anyway, as you can see in the logs, all tests are passing, it's just it's blocked forever. We can tackle this flaky test in another PR.
Even if some checks are not passing, I'll merge it. See https://github.com/scaleway/serverless-scaleway-functions/pull/210#issuecomment-1889271508.
Summary
What's changed?
deployEachFunction
methodWhy do we need this?
When deploying many functions at the same time (e.g. 50 functions), we would receive a 429 error (rate limit) thrown by Scaleway API. To avoid this, do not run all API requests concurrently, but 1 by 1 (for creation because it's a fast operation) or 5 by 5 (for deployment, as this takes more time).
BTW, this is similar to how Terraform deploy resources (10 by 10), I'm not reinventing something new here.
How have you tested it?
With this
serverless.yaml
containing 50 functions:Then, run
serverless deploy
.Before (interesting logs only):
Now (interesting logs only):
And command
serverless deploy
succeeds.Checklist
Details