From ecf6ff116c165d8f9ea2f98d5855ce7db560be8e Mon Sep 17 00:00:00 2001 From: cahrens Date: Thu, 3 Oct 2024 11:30:01 -0400 Subject: [PATCH 1/4] See if waiting for spinners to go away helps stability --- integration-tests/tests/run-analysis-azure.ts | 2 ++ integration-tests/tests/run-analysis.js | 2 ++ integration-tests/tests/run-rstudio.js | 2 ++ 3 files changed, 6 insertions(+) diff --git a/integration-tests/tests/run-analysis-azure.ts b/integration-tests/tests/run-analysis-azure.ts index 427e7feb9c..8919f9a4b8 100644 --- a/integration-tests/tests/run-analysis-azure.ts +++ b/integration-tests/tests/run-analysis-azure.ts @@ -52,6 +52,8 @@ const testRunAnalysisAzure = _.flowRight( }); await click(page, clickable({ textContains: 'Close' }), { timeout: Millis.ofMinute }); await waitForNoModal(page); + // In addition to spinners related to the side modal, there is a spinner over the page. + await waitForNoSpinners(page); // Navigate to analysis launcher await click(page, clickable({ textContains: `${notebookName}.ipynb` })); diff --git a/integration-tests/tests/run-analysis.js b/integration-tests/tests/run-analysis.js index 351451c745..3dc6f4e5c9 100644 --- a/integration-tests/tests/run-analysis.js +++ b/integration-tests/tests/run-analysis.js @@ -48,6 +48,8 @@ const testRunAnalysisFn = _.flowRight( }); await click(page, clickable({ textContains: 'Close' }), { timeout: Millis.ofMinute }); await waitForNoModal(page); + // In addition to spinners related to the side modal, there is a spinner over the page. + await waitForNoSpinners(page); // Navigate to analysis launcher await click(page, clickable({ textContains: `${notebookName}.ipynb` })); diff --git a/integration-tests/tests/run-rstudio.js b/integration-tests/tests/run-rstudio.js index 4399b3fdc2..486a249487 100644 --- a/integration-tests/tests/run-rstudio.js +++ b/integration-tests/tests/run-rstudio.js @@ -51,6 +51,8 @@ const testRunRStudioFn = _.flowRight( }); await click(page, clickable({ textContains: 'Close' }), { timeout: Millis.ofMinute }); await waitForNoModal(page); + // In addition to spinners related to the side modal, there is a spinner over the page. + await waitForNoSpinners(page); // Navigate to analysis launcher await click(page, clickable({ textContains: `${rFileName}.Rmd` })); From bacb85bce1d699d3af4b957e496b1c8e2fc9328e Mon Sep 17 00:00:00 2001 From: cahrens Date: Thu, 3 Oct 2024 13:03:39 -0400 Subject: [PATCH 2/4] More debugging (temporary). --- integration-tests/tests/run-analysis-azure.ts | 4 +++- integration-tests/tests/run-analysis.js | 4 +++- integration-tests/tests/run-rstudio.js | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/integration-tests/tests/run-analysis-azure.ts b/integration-tests/tests/run-analysis-azure.ts index 8919f9a4b8..44073cf6bc 100644 --- a/integration-tests/tests/run-analysis-azure.ts +++ b/integration-tests/tests/run-analysis-azure.ts @@ -52,7 +52,9 @@ const testRunAnalysisAzure = _.flowRight( }); await click(page, clickable({ textContains: 'Close' }), { timeout: Millis.ofMinute }); await waitForNoModal(page); - // In addition to spinners related to the side modal, there is a spinner over the page. + // Debugging to see if waiting helps (still not clear if modal animation is causing the problem) + await delay(Millis.ofSeconds(5)); + // In addition to spinners related to the side modal, there is a spinner over the page while content loads. await waitForNoSpinners(page); // Navigate to analysis launcher diff --git a/integration-tests/tests/run-analysis.js b/integration-tests/tests/run-analysis.js index 3dc6f4e5c9..837510b383 100644 --- a/integration-tests/tests/run-analysis.js +++ b/integration-tests/tests/run-analysis.js @@ -48,7 +48,9 @@ const testRunAnalysisFn = _.flowRight( }); await click(page, clickable({ textContains: 'Close' }), { timeout: Millis.ofMinute }); await waitForNoModal(page); - // In addition to spinners related to the side modal, there is a spinner over the page. + // Debugging to see if waiting helps (still not clear if modal animation is causing the problem) + await delay(Millis.ofSeconds(5)); + // In addition to spinners related to the side modal, there is a spinner over the page while content loads. await waitForNoSpinners(page); // Navigate to analysis launcher diff --git a/integration-tests/tests/run-rstudio.js b/integration-tests/tests/run-rstudio.js index 486a249487..9a7f3f0436 100644 --- a/integration-tests/tests/run-rstudio.js +++ b/integration-tests/tests/run-rstudio.js @@ -51,7 +51,9 @@ const testRunRStudioFn = _.flowRight( }); await click(page, clickable({ textContains: 'Close' }), { timeout: Millis.ofMinute }); await waitForNoModal(page); - // In addition to spinners related to the side modal, there is a spinner over the page. + // Debugging to see if waiting helps (still not clear if modal animation is causing the problem) + await delay(Millis.ofSeconds(5)); + // In addition to spinners related to the side modal, there is a spinner over the page while content loads. await waitForNoSpinners(page); // Navigate to analysis launcher From 4f6653224607d6753d9e08462e47c25f4c9e63b2 Mon Sep 17 00:00:00 2001 From: cahrens Date: Thu, 3 Oct 2024 14:38:16 -0400 Subject: [PATCH 3/4] Try reducing delay to time of animation. --- integration-tests/tests/run-analysis-azure.ts | 6 +++--- integration-tests/tests/run-analysis.js | 10 +++------- integration-tests/tests/run-rstudio.js | 10 +++------- integration-tests/utils/integration-utils.js | 7 +++++++ 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/integration-tests/tests/run-analysis-azure.ts b/integration-tests/tests/run-analysis-azure.ts index 44073cf6bc..f15ac739bd 100644 --- a/integration-tests/tests/run-analysis-azure.ts +++ b/integration-tests/tests/run-analysis-azure.ts @@ -21,7 +21,7 @@ const { getAnimatedDrawer, input, noSpinnersAfter, - waitForNoModal, + waitForNoModalDrawer, waitForNoSpinners, } = require('../utils/integration-utils'); const { registerTest } = require('../utils/jest-utils'); @@ -51,7 +51,7 @@ const testRunAnalysisAzure = _.flowRight( timeout: Millis.ofMinute, }); await click(page, clickable({ textContains: 'Close' }), { timeout: Millis.ofMinute }); - await waitForNoModal(page); + await waitForNoModalDrawer(page); // Debugging to see if waiting helps (still not clear if modal animation is causing the problem) await delay(Millis.ofSeconds(5)); // In addition to spinners related to the side modal, there is a spinner over the page while content loads. @@ -67,7 +67,7 @@ const testRunAnalysisAzure = _.flowRight( await click(page, clickable({ textContains: 'Open' })); await findText(page, 'Azure Cloud Environment'); await click(page, clickable({ textContains: 'Create' })); - await waitForNoModal(page); + await waitForNoModalDrawer(page); // Wait for env to begin creating await findElement(page, clickable({ textContains: 'JupyterLab Environment' })); diff --git a/integration-tests/tests/run-analysis.js b/integration-tests/tests/run-analysis.js index 837510b383..6d2c2a40e1 100644 --- a/integration-tests/tests/run-analysis.js +++ b/integration-tests/tests/run-analysis.js @@ -16,7 +16,7 @@ const { getAnimatedDrawer, input, noSpinnersAfter, - waitForNoModal, + waitForNoModalDrawer, waitForNoSpinners, } = require('../utils/integration-utils'); const { registerTest } = require('../utils/jest-utils'); @@ -47,11 +47,7 @@ const testRunAnalysisFn = _.flowRight( timeout: Millis.ofMinute, }); await click(page, clickable({ textContains: 'Close' }), { timeout: Millis.ofMinute }); - await waitForNoModal(page); - // Debugging to see if waiting helps (still not clear if modal animation is causing the problem) - await delay(Millis.ofSeconds(5)); - // In addition to spinners related to the side modal, there is a spinner over the page while content loads. - await waitForNoSpinners(page); + await waitForNoModalDrawer(page); // Navigate to analysis launcher await click(page, clickable({ textContains: `${notebookName}.ipynb` })); @@ -65,7 +61,7 @@ const testRunAnalysisFn = _.flowRight( }); await findText(page, 'Jupyter Cloud Environment'); await click(page, clickable({ text: 'Create' })); - await waitForNoModal(page); + await waitForNoModalDrawer(page); // Wait for env to begin creating await findElement(page, clickable({ textContains: 'Jupyter Environment' }), { timeout: Millis.ofSeconds(40) }); diff --git a/integration-tests/tests/run-rstudio.js b/integration-tests/tests/run-rstudio.js index 9a7f3f0436..3941577bd3 100644 --- a/integration-tests/tests/run-rstudio.js +++ b/integration-tests/tests/run-rstudio.js @@ -16,7 +16,7 @@ const { getAnimatedDrawer, input, noSpinnersAfter, - waitForNoModal, + waitForNoModalDrawer, waitForNoSpinners, } = require('../utils/integration-utils'); const { registerTest } = require('../utils/jest-utils'); @@ -50,11 +50,7 @@ const testRunRStudioFn = _.flowRight( timeout: Millis.ofMinute, }); await click(page, clickable({ textContains: 'Close' }), { timeout: Millis.ofMinute }); - await waitForNoModal(page); - // Debugging to see if waiting helps (still not clear if modal animation is causing the problem) - await delay(Millis.ofSeconds(5)); - // In addition to spinners related to the side modal, there is a spinner over the page while content loads. - await waitForNoSpinners(page); + await waitForNoModalDrawer(page); // Navigate to analysis launcher await click(page, clickable({ textContains: `${rFileName}.Rmd` })); @@ -67,7 +63,7 @@ const testRunRStudioFn = _.flowRight( action: () => click(page, clickable({ textContains: 'Open' })), }); await click(page, clickable({ text: 'Create' })); - await waitForNoModal(page); + await waitForNoModalDrawer(page); // Wait for env to begin creating await findElement(page, clickable({ textContains: 'RStudio Environment' }), { timeout: Millis.ofMinutes(2) }); diff --git a/integration-tests/utils/integration-utils.js b/integration-tests/utils/integration-utils.js index 9fa654afdc..3594309f34 100644 --- a/integration-tests/utils/integration-utils.js +++ b/integration-tests/utils/integration-utils.js @@ -233,6 +233,12 @@ const waitForModal = (page, { timeout = 30000 } = {}) => { return page.waitForSelector('.ReactModal__Overlay', { hidden: false, timeout }); }; +const waitForNoModalDrawer = async (page) => { + await waitForNoModal(page); + // Matches the animation transition time + await delay(200); +}; + // Puppeteer works by internally using MutationObserver. We are setting up the listener before // the action to ensure that the spinner rendering is captured by the observer, followed by // waiting for the spinner to be removed @@ -631,6 +637,7 @@ module.exports = { waitForNoModal, waitForMenu, waitForModal, + waitForNoModalDrawer, waitForNoSpinners, withPageLogging, withScreenshot, From c09dac9884b00fd8905fa966f744611355fb3ebe Mon Sep 17 00:00:00 2001 From: cahrens Date: Thu, 3 Oct 2024 15:26:54 -0400 Subject: [PATCH 4/4] cleanup --- integration-tests/tests/run-analysis-azure.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/integration-tests/tests/run-analysis-azure.ts b/integration-tests/tests/run-analysis-azure.ts index f15ac739bd..5daa3883fd 100644 --- a/integration-tests/tests/run-analysis-azure.ts +++ b/integration-tests/tests/run-analysis-azure.ts @@ -52,10 +52,6 @@ const testRunAnalysisAzure = _.flowRight( }); await click(page, clickable({ textContains: 'Close' }), { timeout: Millis.ofMinute }); await waitForNoModalDrawer(page); - // Debugging to see if waiting helps (still not clear if modal animation is causing the problem) - await delay(Millis.ofSeconds(5)); - // In addition to spinners related to the side modal, there is a spinner over the page while content loads. - await waitForNoSpinners(page); // Navigate to analysis launcher await click(page, clickable({ textContains: `${notebookName}.ipynb` }));