Skip to content

Commit

Permalink
test: remove ultra long tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chronark committed Jan 14, 2025
1 parent 46ec2f9 commit f87f0ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 34 deletions.
18 changes: 1 addition & 17 deletions apps/api/src/routes/v1_keys_verifyKey.ratelimit_accuracy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,11 @@ const testCases: {
rps: 200, // 3x the limit
seconds: 180, // 12 windows
},

// Real world: API limit scenario
{
limit: 500,
duration: 60000, // 60s window
rps: 50, // 6x the limit
seconds: 780, // 13 windows
},

// High volume, medium window
{
limit: 1000,
duration: 60000, // 60s window
rps: 100, // 6x the limit
seconds: 720, // 12 windows
},
];

for (const { limit, duration, rps, seconds } of testCases) {
const name = `[${limit} / ${duration / 1000}s], attacked with ${rps} rps for ${seconds}s`;
test(name, { skip: process.env.TEST_LOCAL, retry: 3, timeout: 600_000 }, async (t) => {
test(name, { skip: process.env.TEST_LOCAL, retry: 3, timeout: 1_800_000 }, async (t) => {
const h = await IntegrationHarness.init(t);

const { key, keyId } = await h.createKey();
Expand Down
18 changes: 1 addition & 17 deletions apps/api/src/routes/v1_ratelimits_limit.accuracy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,10 @@ const testCases: {
rps: 200, // 3x the limit
seconds: 180, // 12 windows
},

// Real world: API limit scenario
{
limit: 500,
duration: 60000, // 60s window
rps: 50, // 6x the limit
seconds: 780, // 13 windows
},

// High volume, medium window
{
limit: 1000,
duration: 60000, // 60s window
rps: 100, // 6x the limit
seconds: 720, // 12 windows
},
];
for (const { limit, duration, rps, seconds } of testCases) {
const name = `[${limit} / ${duration / 1000}s], attacked with ${rps} rps for ${seconds}s`;
test(name, { skip: process.env.TEST_LOCAL, retry: 3, timeout: 600_000 }, async (t) => {
test(name, { skip: process.env.TEST_LOCAL, retry: 3, timeout: 1_800_000 }, async (t) => {
const h = await IntegrationHarness.init(t);
const namespace = {
id: newId("test"),
Expand Down

0 comments on commit f87f0ff

Please sign in to comment.