fix(xo-server-test): extend timeout of deleteTempResources (#5117)

This commit is contained in:
badrAZ 2020-07-07 13:31:13 +02:00 committed by GitHub
parent cda39ec256
commit dfdd0a0496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,8 @@
# Vendor config: DO NOT TOUCH!
#
# See sample.config.toml to override.
# After some executions we saw that `deleteTempResources` takes around `21s`.
# Then, we chose a large timeout to be sure that all resources created by `xo-server-test`
# will be deleted
deleteTempResourcesTimeout = '2 minutes'

View File

@ -31,6 +31,7 @@
"@babel/plugin-proposal-decorators": "^7.4.0",
"@babel/preset-env": "^7.1.6",
"@iarna/toml": "^2.2.1",
"@vates/parse-duration": "^0.1.0",
"app-conf": "^0.7.0",
"babel-plugin-lodash": "^3.2.11",
"golike-defer": "^0.4.1",

View File

@ -4,6 +4,7 @@ import Xo from 'xo-lib'
import XoCollection from 'xo-collection'
import { defaultsDeep, find, forOwn, pick } from 'lodash'
import { fromEvent } from 'promise-toolbox'
import { parseDuration } from '@vates/parse-duration'
import config from './_config'
import { getDefaultName } from './_defaultValues'
@ -278,7 +279,11 @@ afterAll(async () => {
await xo.close()
xo = null
})
afterEach(() => xo.deleteTempResources())
afterEach(async () => {
jest.setTimeout(parseDuration(config.deleteTempResourcesTimeout))
await xo.deleteTempResources()
})
export { xo as default }