diff --git a/changelog.md b/changelog.md index 4b8550a..ca60574 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2025-05-24 - 1.11.1 - fix(tstest) +Clear timeout identifiers after successful test execution and add local CLAUDE settings + +- Ensure timeout IDs are cleared when tests complete to prevent lingering timeouts +- Add .claude/settings.local.json with updated permission settings for CLI commands + ## 2025-05-24 - 1.11.0 - feat(cli) Add new timeout and file range options with enhanced logfile diff logging diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 5d182ac..96d5b71 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/tstest', - version: '1.11.0', + version: '1.11.1', description: 'a test utility to run tests that match test/**/*.ts' } diff --git a/ts/tstest.classes.tstest.ts b/ts/tstest.classes.tstest.ts index 84faaee..97f73b8 100644 --- a/ts/tstest.classes.tstest.ts +++ b/ts/tstest.classes.tstest.ts @@ -153,8 +153,10 @@ export class TsTest { // Handle timeout if specified if (this.timeoutSeconds !== null) { const timeoutMs = this.timeoutSeconds * 1000; + let timeoutId: NodeJS.Timeout; + const timeoutPromise = new Promise((_resolve, reject) => { - setTimeout(() => { + timeoutId = setTimeout(() => { execResultStreaming.childProcess.kill('SIGTERM'); reject(new Error(`Test file timed out after ${this.timeoutSeconds} seconds`)); }, timeoutMs); @@ -165,6 +167,8 @@ export class TsTest { tapParser.handleTapProcess(execResultStreaming.childProcess), timeoutPromise ]); + // Clear timeout if test completed successfully + clearTimeout(timeoutId); } catch (error) { // Handle timeout error tapParser.handleTimeout(this.timeoutSeconds); @@ -294,8 +298,10 @@ export class TsTest { // Handle timeout if specified if (this.timeoutSeconds !== null) { const timeoutMs = this.timeoutSeconds * 1000; + let timeoutId: NodeJS.Timeout; + const timeoutPromise = new Promise((_resolve, reject) => { - setTimeout(() => { + timeoutId = setTimeout(() => { reject(new Error(`Test file timed out after ${this.timeoutSeconds} seconds`)); }, timeoutMs); }); @@ -305,6 +311,8 @@ export class TsTest { evaluatePromise, timeoutPromise ]); + // Clear timeout if test completed successfully + clearTimeout(timeoutId); } catch (error) { // Handle timeout error tapParser.handleTimeout(this.timeoutSeconds);