storj / edge

Storj edge services (including multi-tenant, S3-compatible server to interact with the Storj network)
GNU Affero General Public License v3.0
53 stars 18 forks source link

Improve the gateway test suite for mapped errors #365

Open halkyon opened 1 year ago

halkyon commented 1 year ago

Goal

We want to be sure that the right HTTP status is returned to the user if there's an error, not just a default 500 server error. If a client sees the wrong error like a 500, it will sometimes attempt a retry, which means unnecessary load and wasted retries.

If we bump uplink sometimes the errors mappings can change, e.g. when we enabled upload codepath refactor, there were cases where the wrong HTTP status was returned. There are also cases we don't catch on dev and test until someone exceeds their rate limit and we notice the wrong status is returned to them.

We need to improve the test suite so we can catch those earlier instead of when it hits production on real traffic.

Acceptance Criteria

Notes