File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -210,19 +210,20 @@ export class TestRig {
210210 readToolLogs ( ) {
211211 if ( ! existsSync ( this . telemetryLog ) ) return [ ] ;
212212 const stats = statSync ( this . telemetryLog ) ;
213- if ( stats . size > 500 * 1024 * 1024 ) {
213+ if ( stats . size > 300 * 1024 * 1024 ) {
214214 throw new Error (
215215 `Telemetry log file is too large (${ stats . size } bytes). Possible infinite loop.` ,
216216 ) ;
217217 }
218- // Use Buffer to avoid string length limits for very large logs
219- const buffer = readFileSync ( this . telemetryLog ) ;
220- const content = buffer . toString ( 'utf-8' ) ;
218+
219+ const content = readFileSync ( this . telemetryLog , 'utf-8' ) ;
220+ // Telemetry logs are NDJSON (one JSON object per line)
221221 return content
222- . split ( / (?< = } ) \s * (? = { ) / )
223- . map ( ( obj ) => {
222+ . split ( '\n' )
223+ . filter ( ( line ) => line . trim ( ) . length > 0 )
224+ . map ( ( line ) => {
224225 try {
225- return JSON . parse ( obj . trim ( ) ) ;
226+ return JSON . parse ( line ) ;
226227 } catch {
227228 return null ;
228229 }
You can’t perform that action at this time.
0 commit comments