Skip to content

Commit a447ecd

Browse files
committed
Logging
1 parent 9177553 commit a447ecd

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

src/test/datascience/notebook/helper.ts

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -987,26 +987,33 @@ export async function waitForExecutionCompletedSuccessfullyV2(
987987
disposables: IDisposable[] | DisposableStore
988988
) {
989989
const checkCompletedSuccessfully = () => {
990+
traceInfo(
991+
`10.a Check execution summary: ${cell.index}: Success = ${cell.executionSummary?.success}, order = ${cell.executionSummary?.executionOrder}, End Time = ${cell.executionSummary?.timing?.endTime}`
992+
);
990993
return cell.executionSummary?.success &&
991994
cell.executionSummary.executionOrder &&
992995
cell.executionSummary.timing?.endTime
993996
? true
994997
: false;
995998
};
999+
traceInfo(`10. Check execution summary: Check ${cell.index}`);
9961000
if (checkCompletedSuccessfully()) {
1001+
traceInfo(`11. Check execution summary: Success ${cell.index}`);
9971002
return;
9981003
}
9991004
await new Promise((resolve) => {
1005+
traceInfo(`12. Check execution summary: Event Handler Added ${cell.index}`);
10001006
const disposable = workspace.onDidChangeNotebookDocument((e) => {
10011007
if (e.notebook !== cell.notebook) {
1008+
traceInfo(`13. Check execution summary: Wrong Notebook ${cell.index}`);
10021009
return;
10031010
}
1004-
e.cellChanges.forEach(() => {
1005-
if (checkCompletedSuccessfully()) {
1006-
disposable.dispose();
1007-
resolve;
1008-
}
1009-
});
1011+
traceInfo(`14. Check execution summary: Check ${cell.index}`);
1012+
if (checkCompletedSuccessfully()) {
1013+
traceInfo(`14. Check execution summary: Resolve ${cell.index}`);
1014+
disposable.dispose();
1015+
resolve;
1016+
}
10101017
});
10111018
if (Array.isArray(disposables)) {
10121019
disposables.push(disposable);
@@ -1262,18 +1269,25 @@ export async function waitForTextOutputV2(
12621269
disposables: IDisposable[] | DisposableStore
12631270
) {
12641271
try {
1272+
traceInfo(`2. Check output in cell ${cell.index}`);
12651273
assertHasTextOutputInVSCode(cell, text, index, isExactMatch);
1274+
traceInfo(`3. Check output in cell: Success ${cell.index}`);
12661275
return;
1267-
} catch {
1276+
} catch (ex) {
1277+
traceInfo(`3.a Check output in cell: Fail ${cell.index}`, ex);
12681278
//
12691279
}
12701280
await new Promise<void>((resolve) => {
1281+
traceInfo(`4. Check output in cell: Added EventHandler ${cell.index}`);
12711282
const disposable = workspace.onDidChangeNotebookDocument((e) => {
12721283
if (e.notebook !== cell.notebook) {
1284+
traceInfo(`5. Check output in cell: Wrong Notebook ${cell.index}`);
12731285
return;
12741286
}
12751287
try {
1288+
traceInfo(`6. Check output in cell: Event Received ${cell.index}`);
12761289
assertHasTextOutputInVSCode(cell, text, index, isExactMatch);
1290+
traceInfo(`7. Check output in cell: Resolved ${cell.index}`);
12771291
resolve();
12781292
} catch {
12791293
//

src/test/smoke/datascience.smoke.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ suite('Smoke Tests', function () {
9090
throw new Error(`Python environment not found ${PYTHON_PATH}`);
9191
}
9292
await jupyterExt.exports.openNotebook(notebook.uri, pythonEnv);
93-
93+
traceInfo(`1. Notebook Opened`);
9494
await Promise.all([
9595
vscode.commands.executeCommand<void>('notebook.execute'),
9696
waitForTextOutputV2(notebook.cellAt(0), 'Hello World', 0, false, disposableStore),

0 commit comments

Comments
 (0)