Skip to content

Commit

Permalink
[IA-4783] Increase Stability of IA integration tests. (#4591)
Browse files Browse the repository at this point in the history
Co-authored-by: jdcanas <jcanas@broadinstitute.com>
  • Loading branch information
jdcanas and jdcanas authored Jan 17, 2024
1 parent 1651da5 commit 27fbe26
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 33 deletions.
16 changes: 6 additions & 10 deletions integration-tests/tests/run-analysis-azure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ const {
click,
clickable,
delay,
dismissAllNotifications,
dismissInfoNotifications,
fillIn,
findElement,
findErrorPopup,
findIframe,
findText,
getAnimatedDrawer,
input,
noSpinnersAfter,
openError,
waitForNoModal,
} = require('../utils/integration-utils');
const { registerTest } = require('../utils/jest-utils');
Expand Down Expand Up @@ -64,14 +63,11 @@ const testRunAnalysisAzure = _.flowRight(
await findElement(page, clickable({ textContains: 'Creating' }));

// Wait for env to finish creating, or break early on error
await Promise.race([
findElement(page, clickable({ textContains: 'Running' }), { timeout: Millis.ofMinutes(18) }),
findErrorPopup(page, { timeout: Millis.ofMinutes(18) }),
]);
const hasError = await openError(page);
if (hasError) {
throw new Error('Failed to create cloud environment');
}
await findElement(page, clickable({ textContains: 'Running' }), { timeout: Millis.ofMinutes(18) });

// Here, we dismiss any errors or popups. Its common another areas of the application might throw an error or have pop-ups.
// However, as long as we have a running runtime (which the previous section asserts), the pop-up is not relevant
await dismissAllNotifications(page);

await click(page, clickable({ textContains: 'Open' }));

Expand Down
18 changes: 7 additions & 11 deletions integration-tests/tests/run-analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ const {
clickable,
delay,
dismissInfoNotifications,
dismissAllNotifications,
fillIn,
findElement,
findErrorPopup,
findIframe,
findText,
getAnimatedDrawer,
input,
noSpinnersAfter,
openError,
waitForNoModal,
} = require('../utils/integration-utils');
const { registerTest } = require('../utils/jest-utils');
Expand Down Expand Up @@ -66,15 +65,12 @@ const testRunAnalysisFn = _.flowRight(
await findElement(page, clickable({ textContains: 'Jupyter Environment' }), { timeout: Millis.ofSeconds(40) });
await findElement(page, clickable({ textContains: 'Creating' }), { timeout: Millis.ofSeconds(40) });

// Wait for env to finish creating, or break early on error
await Promise.race([
findElement(page, clickable({ textContains: 'Running' }), { timeout: Millis.ofMinutes(12) }),
findErrorPopup(page, { timeout: Millis.ofMinutes(12) }),
]);
const hasError = await openError(page);
if (hasError) {
throw new Error('Failed to create cloud environment');
}
// Wait for env to finish creating
await findElement(page, clickable({ textContains: 'Running' }), { timeout: Millis.ofMinutes(12) });

// Here, we dismiss any errors or popups. Its common another areas of the application might throw an error or have pop-ups.
// However, as long as we have a running runtime (which the previous section asserts), the pop-up is not relevant
await dismissAllNotifications(page);

await click(page, clickable({ textContains: 'Open' }));

Expand Down
19 changes: 7 additions & 12 deletions integration-tests/tests/run-rstudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ const {
clickable,
delay,
dismissInfoNotifications,
dismissAllNotifications,
fillIn,
findElement,
findErrorPopup,
findIframe,
findText,
getAnimatedDrawer,
input,
noSpinnersAfter,
openError,
waitForNoModal,
} = require('../utils/integration-utils');
const { registerTest } = require('../utils/jest-utils');
Expand Down Expand Up @@ -67,17 +66,13 @@ const testRunRStudioFn = _.flowRight(
await findElement(page, clickable({ textContains: 'RStudio Environment' }), { timeout: Millis.ofMinutes(2) });
await findElement(page, clickable({ textContains: 'Creating' }), { timeout: Millis.ofSeconds(40) });

// Wait for env to finish creating, or break early on error
await Promise.race([
findElement(page, clickable({ textContains: 'Running' }), { timeout: Millis.ofMinutes(12) }),
findErrorPopup(page, { timeout: Millis.ofMinutes(12) }),
]);
const hasError = await openError(page);
if (hasError) {
throw new Error('Failed to create cloud environment');
}
// Wait for env to finish creating
await findElement(page, clickable({ textContains: 'Running' }), { timeout: Millis.ofMinutes(12) });

// Here, we dismiss any errors or popups. Its common another areas of the application might throw an error or have pop-ups.
// However, as long as we have a running runtime (which the previous section asserts), the pop-up is not relevant
await dismissAllNotifications(page);

await dismissInfoNotifications(page);
await click(page, clickable({ textContains: 'Open' }));

// Find the iframe, wait until the RStudio iframe is loaded, and execute some code
Expand Down

0 comments on commit 27fbe26

Please sign in to comment.