Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
Closed
Description
This test fails because we don't receive nothing except first startup message
varapp=require('child_process').exec('node --debug -e "setInterval(console.log, 10,{a: 1})"');app.stderr.on('data',()=>setTimeout(()=>require('net').connect('5858',function(){varbuffer='';vardata=JSON.stringify({"seq":2,"type":"request","command":"evaluate","arguments":{"expression":"1","global":true,"maxStringLength":-1}});this.on('data',(data)=>buffer+=data);this.write(`Content-Length: ${Buffer.byteLength(data,'utf8')}\r\n\r\n${data}`);setTimeout(()=>{varcl=0;varrx=/Content-Length/g;// We wait two messages - startup and evaluation response// We wait two Content-Length heades - one for each messagewhile(rx.exec(buffer))cl++;console.assert(cl==2,'There is no second message');console.log('All works fine');process.exit(0);},300)}),300/* small delay to initialize debugger in app */));But if I change console.log arguments in line 2 - all works fine:
varapp=require('child_process').exec('node --debug -e "setInterval(console.log, 10, 1)"');app.stderr.on('data',()=>setTimeout(()=>require('net').connect('5858',function(){varbuffer='';vardata=JSON.stringify({"seq":2,"type":"request","command":"evaluate","arguments":{"expression":"1","global":true,"maxStringLength":-1}});this.on('data',(data)=>buffer+=data);this.write(`Content-Length: ${Buffer.byteLength(data,'utf8')}\r\n\r\n${data}`);setTimeout(()=>{varcl=0;varrx=/Content-Length/g;// We wait two messages - startup and evaluation response// We wait two Content-Length heades - one for each messagewhile(rx.exec(buffer))cl++;console.assert(cl==2,'There is no second message');console.log('All works fine');process.exit(0);},300)}),300/* small delay to initialize debugger in app */));Metadata
Metadata
Assignees
Labels
No labels