fix(tstest): Clear timeout identifiers after successful test execution and add local CLAUDE settings
This commit is contained in:
		| @@ -1,5 +1,11 @@ | |||||||
| # Changelog | # 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) | ## 2025-05-24 - 1.11.0 - feat(cli) | ||||||
| Add new timeout and file range options with enhanced logfile diff logging | Add new timeout and file range options with enhanced logfile diff logging | ||||||
|  |  | ||||||
|   | |||||||
| @@ -3,6 +3,6 @@ | |||||||
|  */ |  */ | ||||||
| export const commitinfo = { | export const commitinfo = { | ||||||
|   name: '@git.zone/tstest', |   name: '@git.zone/tstest', | ||||||
|   version: '1.11.0', |   version: '1.11.1', | ||||||
|   description: 'a test utility to run tests that match test/**/*.ts' |   description: 'a test utility to run tests that match test/**/*.ts' | ||||||
| } | } | ||||||
|   | |||||||
| @@ -153,8 +153,10 @@ export class TsTest { | |||||||
|     // Handle timeout if specified |     // Handle timeout if specified | ||||||
|     if (this.timeoutSeconds !== null) { |     if (this.timeoutSeconds !== null) { | ||||||
|       const timeoutMs = this.timeoutSeconds * 1000; |       const timeoutMs = this.timeoutSeconds * 1000; | ||||||
|  |       let timeoutId: NodeJS.Timeout; | ||||||
|  |        | ||||||
|       const timeoutPromise = new Promise<void>((_resolve, reject) => { |       const timeoutPromise = new Promise<void>((_resolve, reject) => { | ||||||
|         setTimeout(() => { |         timeoutId = setTimeout(() => { | ||||||
|           execResultStreaming.childProcess.kill('SIGTERM'); |           execResultStreaming.childProcess.kill('SIGTERM'); | ||||||
|           reject(new Error(`Test file timed out after ${this.timeoutSeconds} seconds`)); |           reject(new Error(`Test file timed out after ${this.timeoutSeconds} seconds`)); | ||||||
|         }, timeoutMs); |         }, timeoutMs); | ||||||
| @@ -165,6 +167,8 @@ export class TsTest { | |||||||
|           tapParser.handleTapProcess(execResultStreaming.childProcess), |           tapParser.handleTapProcess(execResultStreaming.childProcess), | ||||||
|           timeoutPromise |           timeoutPromise | ||||||
|         ]); |         ]); | ||||||
|  |         // Clear timeout if test completed successfully | ||||||
|  |         clearTimeout(timeoutId); | ||||||
|       } catch (error) { |       } catch (error) { | ||||||
|         // Handle timeout error |         // Handle timeout error | ||||||
|         tapParser.handleTimeout(this.timeoutSeconds); |         tapParser.handleTimeout(this.timeoutSeconds); | ||||||
| @@ -294,8 +298,10 @@ export class TsTest { | |||||||
|     // Handle timeout if specified |     // Handle timeout if specified | ||||||
|     if (this.timeoutSeconds !== null) { |     if (this.timeoutSeconds !== null) { | ||||||
|       const timeoutMs = this.timeoutSeconds * 1000; |       const timeoutMs = this.timeoutSeconds * 1000; | ||||||
|  |       let timeoutId: NodeJS.Timeout; | ||||||
|  |        | ||||||
|       const timeoutPromise = new Promise<void>((_resolve, reject) => { |       const timeoutPromise = new Promise<void>((_resolve, reject) => { | ||||||
|         setTimeout(() => { |         timeoutId = setTimeout(() => { | ||||||
|           reject(new Error(`Test file timed out after ${this.timeoutSeconds} seconds`)); |           reject(new Error(`Test file timed out after ${this.timeoutSeconds} seconds`)); | ||||||
|         }, timeoutMs); |         }, timeoutMs); | ||||||
|       }); |       }); | ||||||
| @@ -305,6 +311,8 @@ export class TsTest { | |||||||
|           evaluatePromise, |           evaluatePromise, | ||||||
|           timeoutPromise |           timeoutPromise | ||||||
|         ]); |         ]); | ||||||
|  |         // Clear timeout if test completed successfully | ||||||
|  |         clearTimeout(timeoutId); | ||||||
|       } catch (error) { |       } catch (error) { | ||||||
|         // Handle timeout error |         // Handle timeout error | ||||||
|         tapParser.handleTimeout(this.timeoutSeconds); |         tapParser.handleTimeout(this.timeoutSeconds); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user