diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-11-03 03:07:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-03 03:07:44 +0100 |
commit | ba93afbddd4930408129e863957fd7b631582ae2 (patch) | |
tree | 24b234a3f28aea4fc7f1254a2c8f73b8c548704a | |
parent | 4e2b4b82d584be98efb730732711e2f6c896b7ab (diff) | |
parent | cdfa5663044ea683422232ae51613939a3b66044 (diff) | |
download | nextcloud-server-ba93afbddd4930408129e863957fd7b631582ae2.tar.gz nextcloud-server-ba93afbddd4930408129e863957fd7b631582ae2.zip |
Merge pull request #41250 from nextcloud/chore/cypress-timeout
fix(cypress): Add timeout for waiting on Nextcloud server
-rw-r--r-- | cypress/dockerNode.ts | 10 | ||||
-rw-r--r-- | package-lock.json | 10 | ||||
-rw-r--r-- | package.json | 1 |
3 files changed, 20 insertions, 1 deletions
diff --git a/cypress/dockerNode.ts b/cypress/dockerNode.ts index 790200b9c21..38bc86d9c5f 100644 --- a/cypress/dockerNode.ts +++ b/cypress/dockerNode.ts @@ -233,7 +233,15 @@ export const getContainerIP = async function( // https://github.com/cypress-io/cypress/issues/22676 export const waitOnNextcloud = async function(ip: string) { console.log('├─ Waiting for Nextcloud to be ready... ⏳') - await waitOn({ resources: [`http://${ip}/index.php`] }) + await waitOn({ + resources: [`http://${ip}/index.php`], + // wait for nextcloud to be up and return any non error status + validateStatus: (status) => status >= 200 && status < 400, + // timout in ms + timeout: 5 * 60 * 1000, + // timeout for a single HTTP request + httpTimeout: 60 * 1000, + }) console.log('└─ Done') } diff --git a/package-lock.json b/package-lock.json index ce96bd3ae29..a40a7e67357 100644 --- a/package-lock.json +++ b/package-lock.json @@ -106,6 +106,7 @@ "@testing-library/vue": "^5.8.3", "@types/dockerode": "^3.3.21", "@types/jest": "^29.5.2", + "@types/wait-on": "^5.3.3", "@vue/test-utils": "^1.3.5", "@vue/tsconfig": "^0.4.0", "@vue/vue2-jest": "^29.2.6", @@ -6160,6 +6161,15 @@ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.7.tgz", "integrity": "sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==" }, + "node_modules/@types/wait-on": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/@types/wait-on/-/wait-on-5.3.3.tgz", + "integrity": "sha512-I8EnhU/DuvV2LODzBcLw85FPFFZ9mBvtgqfsgXbhkbo5IZYfIne5qxPTv4PGbD8d5uDQJG5g/pGwGdpM8lQ6Lg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/web-bluetooth": { "version": "0.0.17", "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.17.tgz", diff --git a/package.json b/package.json index 94c03bbcace..7771e16ce24 100644 --- a/package.json +++ b/package.json @@ -133,6 +133,7 @@ "@testing-library/vue": "^5.8.3", "@types/dockerode": "^3.3.21", "@types/jest": "^29.5.2", + "@types/wait-on": "^5.3.3", "@vue/test-utils": "^1.3.5", "@vue/tsconfig": "^0.4.0", "@vue/vue2-jest": "^29.2.6", |