diff --git a/services/docker-compose.yml b/services/docker-compose.yml index 7eac1e7aaf4..ca769e90bf0 100644 --- a/services/docker-compose.yml +++ b/services/docker-compose.yml @@ -272,6 +272,10 @@ services: - default - interactive_services_subnet - computational_services_subnet + healthcheck: + test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER}"] + interval: 15s + retries: 5 # NOTES: this is not yet compatible with portainer deployment but could work also for other containers # works with Docker 19.03 and not yet with Portainer 1.23.0 (see https://github.com/portainer/portainer/issues/3551) # in the meantime postgres allows to set a configuration through CLI. @@ -299,6 +303,11 @@ services: networks: - default - computational_services_subnet + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 5s + timeout: 30s + retries: 50 traefik: image: traefik:v2.2.1 diff --git a/tests/e2e/tutorials/jupyters.js b/tests/e2e/tutorials/jupyters.js index 368bf3a0dc6..81693992357 100644 --- a/tests/e2e/tutorials/jupyters.js +++ b/tests/e2e/tutorials/jupyters.js @@ -27,13 +27,14 @@ async function runTutorial() { const workbenchData = utils.extractWorkbenchData(studyData["data"]); await tutorial.waitForServices(workbenchData["studyId"], [workbenchData["nodeIds"][1], workbenchData["nodeIds"][2]]); + await tutorial.waitFor(2000); // open jupyterNB await tutorial.openNode(1); const iframeHandles = await tutorial.getIframe(); const iframes = []; - for (let i=0; i el.textContent, element); + console.log('Results for the notebook cell is:', value); + // NOTE: we need to wait here to get the results. + await tutorial.waitFor(10000); + await tutorial.openNodeFiles(1); const outFiles = [ "TheNumberNumber.txt", @@ -77,7 +89,7 @@ async function runTutorial() { const iframeHandles2 = await tutorial.getIframe(); const iframes2 = []; - for (let i=0; i el.textContent, jLabElement); + console.log('Checking results for the jupyter lab cell:', jLabVvalue); await tutorial.takeScreenshot("pressRunJLab"); - + // wait sufficiently before getting the results + await tutorial.waitFor(10000); console.log('Checking results for the jupyter lab:'); await tutorial.openNodeFiles(2); const outFiles2 = [ diff --git a/tests/e2e/tutorials/tutorialBase.js b/tests/e2e/tutorials/tutorialBase.js index 84dfe4390cd..fd1580a72f8 100644 --- a/tests/e2e/tutorials/tutorialBase.js +++ b/tests/e2e/tutorials/tutorialBase.js @@ -179,7 +179,7 @@ class TutorialBase { console.error(`"${this.__templateName}" template could not be started:\n`, err); throw (err); } - await this.__page.waitFor(waitFor); + await this.__page.waitForTimeout(waitFor); await this.takeScreenshot("dashboardOpenFirstTemplate_after"); return resp; } @@ -197,7 +197,7 @@ class TutorialBase { console.error(`"${this.__templateName}" service could not be started:\n`, err); throw (err); } - await this.__page.waitFor(waitFor); + await this.__page.waitForTimeout(waitFor); await this.takeScreenshot("dashboardOpenFirstService_after"); return resp; } @@ -296,7 +296,7 @@ class TutorialBase { async retrieve(waitAfterRetrieve = 5000) { await auto.clickRetrieve(this.__page); - await this.__page.waitFor(waitAfterRetrieve); + await this.__page.waitForTimeout(waitAfterRetrieve); } async openNodeRetrieveAndRestart(nodePosInTree = 0) { @@ -380,7 +380,7 @@ class TutorialBase { } async waitFor(waitFor) { - await this.__page.waitFor(waitFor); + await this.__page.waitForTimeout(waitFor); } async takeScreenshot(screenshotTitle) { diff --git a/tests/e2e/utils/auto.js b/tests/e2e/utils/auto.js index 0b0d06c4bb7..16cf094a880 100644 --- a/tests/e2e/utils/auto.js +++ b/tests/e2e/utils/auto.js @@ -314,7 +314,7 @@ async function checkDataProducedByNode(page, nFiles = 1) { let children = []; const minTime = 1000; // wait a bit longer for fetching the files for (let i = 0; i < tries && children.length === 0; i++) { - await page.waitFor(minTime * (i + 1)); + await page.waitForTimeout(minTime * (i + 1)); await page.waitForSelector('[osparc-test-id="fileTreeItem_NodeFiles"]'); children = await utils.getFileTreeItemIDs(page, "NodeFiles"); console.log(i + 1, 'try: ', children); diff --git a/tests/e2e/utils/utils.js b/tests/e2e/utils/utils.js index 08b2288dad0..a8a29e9679d 100644 --- a/tests/e2e/utils/utils.js +++ b/tests/e2e/utils/utils.js @@ -246,7 +246,7 @@ async function isServiceConnected(page, studyId, nodeId) { console.log("-- Is Service Connected", nodeId); const serviceUrl = await getServiceUrl(page, studyId, nodeId); const connected = await makePingRequest(page, serviceUrl); - console.log(connected, "--") + console.log(connected ? ("service " + nodeId + " connected") : ("service" + nodeId + " connecting..."), "--") return connected; } @@ -300,10 +300,10 @@ async function waitForValidOutputFile(page) { }) } -async function waitAndClick(page, id) { +async function waitAndClick(page, id, timeout) { await page.waitForSelector(id, { - timeout: 30000 // default 30s - }) + timeout: (timeout ? timeout : 30000) // default 30s + }); await page.click(id); }