From 42624511cf0d337982e4ebcfb2a9ec2baf1c2af6 Mon Sep 17 00:00:00 2001 From: WillLillis Date: Fri, 18 Apr 2025 22:28:51 -0400 Subject: [PATCH] fix(ci): increase timeouts for flaky tests (cherry picked from commit eee41925aa4075b6c0f64c58b5ed917d19a2eb91) --- lib/binding_web/test/parser.test.ts | 2 +- lib/binding_web/test/query.test.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/binding_web/test/parser.test.ts b/lib/binding_web/test/parser.test.ts index 88240d8c..aa1dcd1c 100644 --- a/lib/binding_web/test/parser.test.ts +++ b/lib/binding_web/test/parser.test.ts @@ -256,7 +256,7 @@ describe('Parser', () => { expect(() => parser.parse({})).toThrow('Argument must be a string or a function'); }); - it('handles long input strings', { timeout: 5000 }, () => { + it('handles long input strings', { timeout: 10000 }, () => { const repeatCount = 10000; const inputString = `[${Array(repeatCount).fill('0').join(',')}]`; diff --git a/lib/binding_web/test/query.test.ts b/lib/binding_web/test/query.test.ts index f10c5f28..546c2a19 100644 --- a/lib/binding_web/test/query.test.ts +++ b/lib/binding_web/test/query.test.ts @@ -64,7 +64,7 @@ describe('Query', () => { }); describe('.matches', () => { - it('returns all of the matches for the given query', () => { + it('returns all of the matches for the given query', { timeout: 10000 }, () => { tree = parser.parse('function one() { two(); function three() {} }')!; query = new Query(JavaScript, ` (function_declaration name: (identifier) @fn-def) @@ -462,7 +462,7 @@ describe('Query', () => { }); describe('Set a timeout', () => { - it('returns less than the expected matches', () => { + it('returns less than the expected matches', { timeout: 10000 }, () => { tree = parser.parse('function foo() while (true) { } }\n'.repeat(1000))!; query = new Query(JavaScript, '(function_declaration name: (identifier) @function)'); const matches = query.matches(tree.rootNode, { timeoutMicros: 1000 }); @@ -538,7 +538,7 @@ describe('Query', () => { }); }); - describe('Executes with a timeout', () => { + describe('Executes with a timeout', { timeout: 10000 }, () => { it('Returns less than the expected matches', () => { tree = parser.parse('function foo() while (true) { } }\n'.repeat(1000))!; query = new Query(JavaScript, '(function_declaration) @function');