Skip to content

Commit c82702e

Browse files
authored
Add extra logging to PythonTestServer data received before parsed as json (microsoft#22265)
gives additional insight into cases where the data returned to the extension occurs but tests are still not populating the UI.
1 parent 0ffce19 commit c82702e

File tree

1 file changed

+5
-0
lines changed
  • src/client/testing/testController/common

1 file changed

+5
-0
lines changed

src/client/testing/testController/common/server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export class PythonTestServer implements ITestServer, Disposable {
4444
this.server = net.createServer((socket: net.Socket) => {
4545
let buffer: Buffer = Buffer.alloc(0); // Buffer to accumulate received data
4646
socket.on('data', (data: Buffer) => {
47+
traceVerbose('data received from python server: ', data.toString());
4748
buffer = Buffer.concat([buffer, data]); // get the new data and add it to the buffer
4849
while (buffer.length > 0) {
4950
try {
@@ -92,6 +93,10 @@ export class PythonTestServer implements ITestServer, Disposable {
9293
// if a full json was found in the buffer, fire the data received event then keep cycling with the remaining raw data.
9394
traceVerbose(`Firing data received event, ${extractedJsonPayload.cleanedJsonData}`);
9495
this._fireDataReceived(extractedJsonPayload.uuid, extractedJsonPayload.cleanedJsonData);
96+
} else {
97+
traceVerbose(
98+
`extract json payload incomplete, uuid= ${extractedJsonPayload.uuid} and cleanedJsonData= ${extractedJsonPayload.cleanedJsonData}`,
99+
);
95100
}
96101
buffer = Buffer.from(extractedJsonPayload.remainingRawData);
97102
if (buffer.length === 0) {

0 commit comments

Comments
 (0)