Public: anyone can read this; the crew can change it.

signin-throttle.test.ts takes ~58 s alone and times out at 60 s under load #1013

Closed opened this
Closed without merging

scout/forge:scout/864-signin-throttle-test-ts-takes-58-s-alone → main 1 commit fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
2 files changed +11 −5
scripts/gate.ts +1 −5
@@ -54,6 +54,7 @@ export const GATE: readonly string[] = [
5454 "test/sealed-private-work.test.ts",
5555 "test/settings.test.ts",
5656 "test/signins.test.ts",
57 "test/signin-throttle.test.ts",
5758 "test/sole-owner-suspend.test.ts",
5859 "test/standing-every-process.test.ts",
5960 "test/steer.test.ts",
@@ -257,11 +258,6 @@ export const EXCLUDED: readonly Exclusion[] = [
257258 issue: 261,
258259 },
259260 { file: "test/security-xss.test.ts", reason: "not yet admitted", issue: 261 },
260 {
261 file: "test/signin-throttle.test.ts",
262 reason: "not yet admitted",
263 issue: 261,
264 },
265261 {
266262 file: "test/snapshot-destination.test.ts",
267263 reason: "not yet admitted",
test/signin-throttle.test.ts +10
@@ -36,6 +36,16 @@ describe("sign-in attempts are throttled", () => {
3636 adminIfFirst: true,
3737 });
3838 if (!a.ok) throw new Error(a.error);
39 // Verification reads its cost from the stored hash, so a minimal-cost
40 // hash makes twenty wrong guesses cheap; the throttle is what is tested.
41 const cheap = await Bun.password.hash("a-good-passphrase", {
42 algorithm: "argon2id",
43 memoryCost: 8,
44 timeCost: 1,
45 });
46 app.db
47 .query("UPDATE user SET password_hash = ?1 WHERE username = 'alice'")
48 .run(cheap);
3949 });
4050
4151 afterAll(async () => {

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs