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.
This commit is contained in:
Satoshi Qazi Muhammed authored and SatoshiQaziMuhammed committed 2026-10-08 04:09:59 +04:00
1 parent 6ba4cf7580
commit 6f0a5a6805
1 file changed
+2 -1
+2 -1
View File
@@ -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);
});
});