Skip to content

Commit b39253f

Browse files
authored
e2e: fix console-python flake (#10950)
### Summary Fixing the flake in the console-python test. The previous test state was interfering with an assertion in a downstream test, so I added a console clear to ensure the test has a clean console state. While reviewing, I also noticed a redundant test and removed it. ### QA Notes @:console
1 parent 8b24072 commit b39253f

File tree

2 files changed

+13
-26
lines changed

2 files changed

+13
-26
lines changed

test/e2e/tests/console/console-python.test.ts

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,47 +17,40 @@ test.describe('Console Pane: Python', { tag: [tags.WEB, tags.CONSOLE, tags.WIN]
1717
await app.workbench.console.waitForConsoleContents('done', { expectedCount: 2, timeout: 30000 });
1818
});
1919

20-
test('Python - Verify cancel button on console bar', async function ({ app, python }) {
21-
await app.workbench.console.executeCode('Python', 'import time');
22-
await app.workbench.console.executeCode('Python', 'time.sleep(10)', { waitForReady: false });
23-
await app.workbench.console.interruptExecution();
24-
});
25-
2620
test('Python - Verify console commands are queued during execution', async function ({ app, python }) {
21+
await app.workbench.console.clearButton.click();
2722
await app.workbench.console.pasteCodeToConsole('123 + 123');
2823
await app.workbench.console.executeCode('Python', '456 + 456');
2924

3025
await app.workbench.console.waitForConsoleContents('912', { expectedCount: 1, timeout: 10000 });
3126
await app.workbench.console.waitForConsoleContents('123 + 123', { expectedCount: 1, timeout: 10000 });
3227
await app.workbench.console.waitForConsoleContents('246', { expectedCount: 0, timeout: 5000 });
33-
3428
});
3529

3630
test('Python - Verify interrupt stops execution mid-work', async function ({ app, python }) {
31+
const { console } = app.workbench;
32+
3733
// Execute code that does work in a loop and prints progress
3834
const code = `
3935
import time
4036
for i in range(10):
41-
print(f"Step {i}")
42-
time.sleep(1)
37+
print(f"Step {i}")
38+
time.sleep(1)
4339
print("Completed all steps")
4440
`;
45-
await app.workbench.console.executeCode('Python', code, { waitForReady: false });
46-
47-
// Wait for some work to be done (at least 2-3 steps)
48-
await app.workbench.console.waitForConsoleContents('Step 2', { expectedCount: 1, timeout: 10000 });
49-
50-
// Interrupt the execution
51-
await app.workbench.console.interruptExecution();
41+
await console.clearButton.click();
42+
await console.executeCode('Python', code, { waitForReady: false });
5243

53-
// Wait for KeyboardInterrupt to appear
54-
await app.workbench.console.waitForConsoleContents('KeyboardInterrupt', { expectedCount: 1, timeout: 5000 });
44+
// Wait for some work to be done (at least 2-3 steps) and then interrupt
45+
await console.waitForConsoleContents('Step 2', { expectedCount: 1, timeout: 10000 });
46+
await console.interruptExecution();
47+
await console.waitForConsoleContents('KeyboardInterrupt', { expectedCount: 1, timeout: 5000 });
5548

5649
// Verify that some work was done (we saw Step 2)
57-
await app.workbench.console.waitForConsoleContents('Step 2', { expectedCount: 1, timeout: 1000 });
50+
await console.waitForConsoleContents('Step 2', { expectedCount: 1, timeout: 1000 });
5851

5952
// Verify that not all work was completed (Step 9 should not appear)
60-
await app.workbench.console.waitForConsoleContents('Step 9', { expectedCount: 0, timeout: 1000 });
53+
await console.waitForConsoleContents('Step 9', { expectedCount: 0, timeout: 1000 });
6154
});
6255

6356
});

test/e2e/tests/editor-action-bar/editor-action-bar-document-files.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@ test.describe('Editor Action Bar: Document Files', {
6464
await verifySplitEditor('OilandGasMetadata.html');
6565
await verifyOpenInNewWindow(app, '<title> Oil &amp; Gas Wells - Metadata</title>');
6666
});
67-
68-
test('Jupyter Notebook - Verify editor action bar is not visible', {
69-
tag: [tags.NOTEBOOKS],
70-
}, async function ({ app }) {
71-
await app.workbench.editorActionBar.verifyIsVisible(false);
72-
});
7367
});
7468

7569

0 commit comments

Comments
 (0)