Skip to content

Commit 3213d64

Browse files
committed
Logging
1 parent 1ea04de commit 3213d64

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
@@ -975,26 +975,33 @@ export async function waitForExecutionCompletedSuccessfullyV2(
975975
disposables: IDisposable[] | DisposableStore
976976
) {
977977
const checkCompletedSuccessfully = () => {
978+
traceInfo(
979+
`10.a Check execution summary: ${cell.index}: Success = ${cell.executionSummary?.success}, order = ${cell.executionSummary?.executionOrder}, End Time = ${cell.executionSummary?.timing?.endTime}`
980+
);
978981
return cell.executionSummary?.success &&
979982
cell.executionSummary.executionOrder &&
980983
cell.executionSummary.timing?.endTime
981984
? true
982985
: false;
983986
};
987+
traceInfo(`10. Check execution summary: Check ${cell.index}`);
984988
if (checkCompletedSuccessfully()) {
989+
traceInfo(`11. Check execution summary: Success ${cell.index}`);
985990
return;
986991
}
987992
await new Promise((resolve) => {
993+
traceInfo(`12. Check execution summary: Event Handler Added ${cell.index}`);
988994
const disposable = workspace.onDidChangeNotebookDocument((e) => {
989995
if (e.notebook !== cell.notebook) {
996+
traceInfo(`13. Check execution summary: Wrong Notebook ${cell.index}`);
990997
return;
991998
}
992-
e.cellChanges.forEach(() => {
993-
if (checkCompletedSuccessfully()) {
994-
disposable.dispose();
995-
resolve;
996-
}
997-
});
999+
traceInfo(`14. Check execution summary: Check ${cell.index}`);
1000+
if (checkCompletedSuccessfully()) {
1001+
traceInfo(`14. Check execution summary: Resolve ${cell.index}`);
1002+
disposable.dispose();
1003+
resolve;
1004+
}
9981005
});
9991006
if (Array.isArray(disposables)) {
10001007
disposables.push(disposable);
@@ -1250,18 +1257,25 @@ export async function waitForTextOutputV2(
12501257
disposables: IDisposable[] | DisposableStore
12511258
) {
12521259
try {
1260+
traceInfo(`2. Check output in cell ${cell.index}`);
12531261
assertHasTextOutputInVSCode(cell, text, index, isExactMatch);
1262+
traceInfo(`3. Check output in cell: Success ${cell.index}`);
12541263
return;
1255-
} catch {
1264+
} catch (ex) {
1265+
traceInfo(`3.a Check output in cell: Fail ${cell.index}`, ex);
12561266
//
12571267
}
12581268
await new Promise<void>((resolve) => {
1269+
traceInfo(`4. Check output in cell: Added EventHandler ${cell.index}`);
12591270
const disposable = workspace.onDidChangeNotebookDocument((e) => {
12601271
if (e.notebook !== cell.notebook) {
1272+
traceInfo(`5. Check output in cell: Wrong Notebook ${cell.index}`);
12611273
return;
12621274
}
12631275
try {
1276+
traceInfo(`6. Check output in cell: Event Received ${cell.index}`);
12641277
assertHasTextOutputInVSCode(cell, text, index, isExactMatch);
1278+
traceInfo(`7. Check output in cell: Resolved ${cell.index}`);
12651279
resolve();
12661280
} catch {
12671281
//

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)