Skip to content

Commit ac514d8

Browse files
authored
e2e: fix reticulate multi-session race by explicitly selecting session (#14902)
1 parent 13c90bd commit ac514d8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/e2e/tests/reticulate/helpers/verifyReticulateFunction.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ export async function verifyReticulateFunctionality(
1717
zValue = '6'): Promise<void> {
1818
const { console, sessions, variables } = app.workbench;
1919

20+
// Explicitly select the Python session before running code -- with multiple concurrent
21+
// sessions of the same language, `console.executeCode` targets whichever session happens
22+
// to be foreground, which races with session startup/rename.
23+
await sessions.select(pythonSessionId);
24+
2025
// Create a variable x in Python session
2126
await expect(async () => {
2227
await console.executeCode('Python', `x = ${xValue}`);
@@ -25,6 +30,7 @@ export async function verifyReticulateFunctionality(
2530

2631
// Switch to the R session and create an R variable `y` by accessing the Python
2732
// variable `x` through reticulate.
33+
await sessions.select(rSessionId);
2834
await expect(async () => {
2935
await console.executeCode('R', 'y<-reticulate::py$x');
3036
await variables.expectVariableToBe('y', xValue, 2000);

0 commit comments

Comments
 (0)