Skip to content

Commit eb649d0

Browse files
authored
Add some logging to identify flaky notebooks tests (microsoft#261200)
1 parent 57235e3 commit eb649d0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

extensions/vscode-api-tests/src/singlefolder-tests/notebook.kernel.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ async function createRandomNotebookFile() {
1414
}
1515

1616
async function openRandomNotebookDocument() {
17+
console.log('Creating a random notebook file');
1718
const uri = await createRandomNotebookFile();
19+
console.log('Created a random notebook file');
1820
return vscode.workspace.openNotebookDocument(uri);
1921
}
2022

@@ -119,6 +121,7 @@ const apiTestSerializer: vscode.NotebookSerializer = {
119121
}
120122
]
121123
};
124+
console.log('Returning NotebookData in deserializeNotebook');
122125
return dto;
123126
}
124127
};
@@ -159,39 +162,61 @@ const apiTestSerializer: vscode.NotebookSerializer = {
159162
});
160163

161164
test('cell execute command takes arguments', async () => {
165+
console.log('Step1.cell execute command takes arguments');
162166
const notebook = await openRandomNotebookDocument();
167+
console.log('Step2.cell execute command takes arguments');
163168
await vscode.window.showNotebookDocument(notebook);
169+
console.log('Step3.cell execute command takes arguments');
164170
assert.strictEqual(vscode.window.activeNotebookEditor !== undefined, true, 'notebook first');
165171
const editor = vscode.window.activeNotebookEditor!;
166172
const cell = editor.notebook.cellAt(0);
167173

174+
console.log('Step4.cell execute command takes arguments');
168175
await withEvent(vscode.workspace.onDidChangeNotebookDocument, async event => {
176+
console.log('Step5.cell execute command takes arguments');
169177
await vscode.commands.executeCommand('notebook.execute');
178+
console.log('Step6.cell execute command takes arguments');
170179
await event;
180+
console.log('Step7.cell execute command takes arguments');
171181
assert.strictEqual(cell.outputs.length, 1, 'should execute'); // runnable, it worked
172182
});
173183

184+
console.log('Step8.cell execute command takes arguments');
174185
await withEvent(vscode.workspace.onDidChangeNotebookDocument, async event => {
186+
console.log('Step9.cell execute command takes arguments');
175187
await vscode.commands.executeCommand('notebook.cell.clearOutputs');
188+
console.log('Step10.cell execute command takes arguments');
176189
await event;
190+
console.log('Step11.cell execute command takes arguments');
177191
assert.strictEqual(cell.outputs.length, 0, 'should clear');
178192
});
179193

194+
console.log('Step12.cell execute command takes arguments');
180195
const secondResource = await createRandomNotebookFile();
196+
console.log('Step13.cell execute command takes arguments');
181197
const secondDocument = await vscode.workspace.openNotebookDocument(secondResource);
198+
console.log('Step14.cell execute command takes arguments');
182199
await vscode.window.showNotebookDocument(secondDocument);
200+
console.log('Step15.cell execute command takes arguments');
183201

184202
await withEvent<vscode.NotebookDocumentChangeEvent>(vscode.workspace.onDidChangeNotebookDocument, async event => {
203+
console.log('Step16.cell execute command takes arguments');
185204
await vscode.commands.executeCommand('notebook.cell.execute', { start: 0, end: 1 }, notebook.uri);
205+
console.log('Step17.cell execute command takes arguments');
186206
await event;
207+
console.log('Step18.cell execute command takes arguments');
187208
assert.strictEqual(cell.outputs.length, 1, 'should execute'); // runnable, it worked
188209
assert.strictEqual(vscode.window.activeNotebookEditor?.notebook.uri.fsPath, secondResource.fsPath);
189210
});
211+
console.log('Step19.cell execute command takes arguments');
190212
});
191213

192214
test('cell execute command takes arguments 2', async () => {
215+
console.log('Step1.cell execute command takes arguments 2');
193216
const notebook = await openRandomNotebookDocument();
217+
console.log('Step2.cell execute command takes arguments 2');
194218
await vscode.window.showNotebookDocument(notebook);
219+
console.log('Step3.cell execute command takes arguments 2');
195220

196221
let firstCellExecuted = false;
197222
let secondCellExecuted = false;

0 commit comments

Comments
 (0)