Skip to content

Commit d21fa94

Browse files
committed
test: relax performance thresholds for CI environments
1 parent 6c167ba commit d21fa94

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/benchmarks.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import vard from "../src";
33

44
describe("Performance Benchmarks", () => {
55
describe("Throughput", () => {
6-
it("should achieve > 20,000 ops/sec for safe inputs", () => {
6+
it("should achieve > 15,000 ops/sec for safe inputs", () => {
77
const iterations = 100000;
88
const input = "Hello, how can I help you today?";
99

@@ -15,7 +15,7 @@ describe("Performance Benchmarks", () => {
1515

1616
const opsPerSec = (iterations / elapsed) * 1000;
1717
console.log(`Throughput (safe inputs): ${opsPerSec.toFixed(0)} ops/sec`);
18-
expect(opsPerSec).toBeGreaterThan(20000);
18+
expect(opsPerSec).toBeGreaterThan(15000);
1919
});
2020

2121
it("should handle malicious inputs at > 10,000 ops/sec", () => {

tests/redos.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe("ReDoS Prevention", () => {
7272
// Should pass, no threats
7373
}
7474
const elapsed = performance.now() - start;
75-
expect(elapsed).toBeLessThan(250); // Relaxed threshold for CI + obfuscation patterns
75+
expect(elapsed).toBeLessThan(250);
7676
});
7777

7878
it("should handle pathological regex input", () => {

0 commit comments

Comments
 (0)