44 * SPDX-License-Identifier: Apache-2.0
55 */
66
7- import { describe , it } from 'node:test' ;
87import assert from 'node:assert' ;
98import { spawn } from 'node:child_process' ;
109import fs from 'node:fs' ;
11- import path from 'node:path' ;
1210import os from 'node:os' ;
11+ import path from 'node:path' ;
12+ import { describe , it } from 'node:test' ;
1313
1414describe ( 'Telemetry E2E' , ( ) => {
1515 async function runTelemetryTest ( signal : NodeJS . Signals ) {
@@ -78,7 +78,7 @@ describe('Telemetry E2E', () => {
7878 const checkInterval = setInterval ( ( ) => {
7979 try {
8080 process . kill ( watchdogPid ! , 0 ) ; // Check if running
81- } catch ( e ) {
81+ } catch {
8282 clearInterval ( checkInterval ) ;
8383 resolve ( ) ;
8484 return ;
@@ -87,7 +87,11 @@ describe('Telemetry E2E', () => {
8787
8888 setTimeout ( ( ) => {
8989 clearInterval ( checkInterval ) ;
90- try { process . kill ( watchdogPid ! , 'SIGKILL' ) ; } catch { }
90+ try {
91+ process . kill ( watchdogPid ! , 'SIGKILL' ) ;
92+ } catch {
93+ // no-op
94+ }
9195 reject ( new Error ( 'Timeout waiting for Watchdog exit' ) ) ;
9296 } , 5000 ) ;
9397 } ) ;
@@ -102,7 +106,7 @@ describe('Telemetry E2E', () => {
102106 console . log ( `[${ signal } ] Shutdown events verified` ) ;
103107
104108 // Cleanup
105- if ( fs . existsSync ( logFile ) ) fs . unlinkSync ( logFile ) ;
109+ if ( fs . existsSync ( logFile ) ) { fs . unlinkSync ( logFile ) ; }
106110 }
107111
108112 async function runFixtureTest ( action : 'exit-0' | 'exit-1' | 'crash' ) {
@@ -165,7 +169,7 @@ describe('Telemetry E2E', () => {
165169 const checkInterval = setInterval ( ( ) => {
166170 try {
167171 process . kill ( watchdogPid ! , 0 ) ;
168- } catch ( e ) {
172+ } catch {
169173 clearInterval ( checkInterval ) ;
170174 resolve ( ) ;
171175 return ;
@@ -174,7 +178,11 @@ describe('Telemetry E2E', () => {
174178
175179 setTimeout ( ( ) => {
176180 clearInterval ( checkInterval ) ;
177- try { process . kill ( watchdogPid ! , 'SIGKILL' ) ; } catch { }
181+ try {
182+ process . kill ( watchdogPid ! , 'SIGKILL' ) ;
183+ } catch {
184+ // no-op
185+ }
178186 reject ( new Error ( 'Timeout waiting for Watchdog exit' ) ) ;
179187 } , 5000 ) ;
180188 } ) ;
@@ -187,7 +195,7 @@ describe('Telemetry E2E', () => {
187195 assert . match ( contentAfter , / s e r v e r _ s h u t d o w n / ) ;
188196 console . log ( `[${ action } ] Shutdown events verified` ) ;
189197
190- if ( fs . existsSync ( logFile ) ) fs . unlinkSync ( logFile ) ;
198+ if ( fs . existsSync ( logFile ) ) { fs . unlinkSync ( logFile ) ; }
191199 }
192200
193201 it ( 'handles clean exit (process.exit(0))' , ( ) => runFixtureTest ( 'exit-0' ) ) ;
0 commit comments