From 6f0a5a68051a297a2d32ba42e9203f4a1fd3ff95 Mon Sep 17 00:00:00 2001 From: Satoshi Qazi Muhammed Date: Thu, 8 Oct 2026 04:03:56 +0400 Subject: [PATCH] typegen: give the isInlineStruct timing test room on a loaded machine The bound was 100 ms and the test failed once inside the full suite. The regex it guards against needs about 9 s on that input and the linear check about 1 ms, so 1 s still fails on the regex and does not fail on a busy runner. --- packages/typegen/src/util/formatting.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/typegen/src/util/formatting.spec.ts b/packages/typegen/src/util/formatting.spec.ts index e7102a3..25d077a 100644 --- a/packages/typegen/src/util/formatting.spec.ts +++ b/packages/typegen/src/util/formatting.spec.ts @@ -48,9 +48,10 @@ describe('isInlineStruct', (): void => { }); it('is linear on input that made the regex backtrack', (): void => { + // /^{.+:.+}/ needs ~9s here, the linear check ~1ms; 1s leaves room for a loaded machine const start = Date.now(); expect(isInlineStruct(`{{${'a:'.repeat(100_000)}`)).toBe(false); - expect(Date.now() - start < 100).toBe(true); + expect(Date.now() - start < 1000).toBe(true); }); });