Skip to content

Commit

Permalink
remove debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorjboyd committed Jul 19, 2023
1 parent 16cc307 commit 6d32bf7
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 14 deletions.
5 changes: 0 additions & 5 deletions src/client/testing/testController/common/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export class PythonTestServer implements ITestServer, Disposable {
private _onDiscoveryDataReceived: EventEmitter<DataReceivedEvent> = new EventEmitter<DataReceivedEvent>();

constructor(private executionFactory: IPythonExecutionFactory, private debugLauncher: ITestDebugLauncher) {
traceLog('ABCDEFG::: testing for UUID, if no error then good');
this.server = net.createServer((socket: net.Socket) => {
let buffer: Buffer = Buffer.alloc(0); // Buffer to accumulate received data
socket.on('data', (data: Buffer) => {
Expand All @@ -43,7 +42,6 @@ export class PythonTestServer implements ITestServer, Disposable {
const rpcHeaders = jsonRPCHeaders(buffer.toString());
const uuid = rpcHeaders.headers.get(JSONRPC_UUID_HEADER);
const totalContentLength = rpcHeaders.headers.get('Content-Length');
traceLog('ABCDEFG::: testing for UUID, if no error then good', uuid);
if (!uuid) {
traceError('On data received: Error occurred because payload UUID is undefined');
this._onDataReceived.fire({ uuid: '', data: '' });
Expand Down Expand Up @@ -124,7 +122,6 @@ export class PythonTestServer implements ITestServer, Disposable {
}

public deleteUUID(uuid: string): void {
traceLog('ABCDEFG::: DELETE IS OCCURRRING');
this.uuids = this.uuids.filter((u) => u !== uuid);
}

Expand Down Expand Up @@ -228,8 +225,6 @@ export class PythonTestServer implements ITestServer, Disposable {
errors: [(ex as Error).message],
}),
});
} finally {
traceLog('ABCDEFG::: done with send command, NO deletion :)');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export class PytestTestDiscoveryAdapter implements ITestDiscoveryAdapter {
const result = execService?.execObservable(execArgs, spawnOptions);

result?.proc?.on('close', () => {
traceLog('ABCDEFG::: callback on proc close, delete UUID.', uuid);
deferred2.resolve({ stdout: '', stderr: '' });
this.testServer.deleteUUID(uuid);
deferred.resolve();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
debugLauncher?: ITestDebugLauncher,
): Promise<ExecutionTestPayload> {
const uuid = this.testServer.createUUID(uri.fsPath);
traceLog('ABCDEFG::: create UUID for run', uuid);
traceVerbose(uri, testIds, debugBool);
const disposedDataReceived = this.testServer.onRunDataReceived((e: DataReceivedEvent) => {
if (runInstance) {
this.resultResolver?.resolveExecution(JSON.parse(e.data), runInstance);
}
});
const dispose = function (testServer: ITestServer) {
traceLog('ABCDEFG::: dispose w/ uuid', uuid);
testServer.deleteUUID(uuid);
disposedDataReceived.dispose();
};
Expand Down Expand Up @@ -168,7 +166,6 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
});

result?.proc?.on('close', () => {
traceLog('ABCDEFG::: callback on proc close, delete UUID.', uuid);
deferred2.resolve({ stdout: '', stderr: '' });
this.testServer.deleteUUID(uuid);
deferred.resolve();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
TestCommandOptions,
TestDiscoveryCommand,
} from '../common/types';
import { traceLog } from '../../../logging';

/**
* Wrapper class for unittest test discovery. This is where we call `runTestCommand`.
Expand All @@ -35,7 +34,6 @@ export class UnittestTestDiscoveryAdapter implements ITestDiscoveryAdapter {
const command = buildDiscoveryCommand(unittestArgs);

const uuid = this.testServer.createUUID(uri.fsPath);
traceLog(`ABCDEFG: create UUID ${uuid}`);

const options: TestCommandOptions = {
workspaceFolder: uri,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ export class UnittestTestExecutionAdapter implements ITestExecutionAdapter {
runInstance?: TestRun,
): Promise<ExecutionTestPayload> {
const uuid = this.testServer.createUUID(uri.fsPath);
traceLog('ABCDEFG::: created UUID', uuid);
const disposedDataReceived = this.testServer.onRunDataReceived((e: DataReceivedEvent) => {
if (runInstance) {
this.resultResolver?.resolveExecution(JSON.parse(e.data), runInstance);
}
});
const dispose = function () {
traceLog('ABCDEFG::: no dispose of uuid :)');
disposedDataReceived.dispose();
};
runInstance?.token.onCancellationRequested(() => {
Expand Down Expand Up @@ -90,7 +88,6 @@ export class UnittestTestExecutionAdapter implements ITestExecutionAdapter {
const runTestIdsPort = await startTestIdServer(testIds);

await this.testServer.sendCommand(options, runTestIdsPort.toString(), runInstance, () => {
traceLog('ABCDEFG::: resolve deferred, of send command in execution to then call delete UUID');
this.testServer.deleteUUID(uuid);
deferred.resolve();
dispose?.();
Expand Down

0 comments on commit 6d32bf7

Please sign in to comment.