mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-11 08:16:28 +00:00
Merge pull request #3241 from overleaf/jpa-speedup-acceptance-tests
[misc] speedup the ConvertArchivedState test suite GitOrigin-RevId: e7d6471955aabbc6af76e27fdf23d97e2fd87901
This commit is contained in:
parent
562fb35416
commit
2a3cb615ee
2 changed files with 12 additions and 8 deletions
|
@ -33,7 +33,8 @@ async function batchedUpdate(collectionName, query, update, projection) {
|
|||
// Some secondary connections are not ready as it returns, leading to
|
||||
// failing cursor actions with a readPreference set to 'secondary'.
|
||||
// TODO(das7pad): revisit/remove this delay after the mongo-driver update.
|
||||
await Promise.all([getNativeDb(), promisify(setTimeout)(10 * 1000)])
|
||||
const CONNECT_DELAY = parseInt(process.env.CONNECT_DELAY, 10) || 10000
|
||||
await Promise.all([getNativeDb(), promisify(setTimeout)(CONNECT_DELAY)])
|
||||
|
||||
const db = await getNativeDb()
|
||||
const collection = db.collection(collectionName)
|
||||
|
|
|
@ -67,14 +67,17 @@ describe('ConvertArchivedState', function() {
|
|||
})
|
||||
|
||||
beforeEach(function(done) {
|
||||
exec('node scripts/convert_archived_state.js', (error, stdout, stderr) => {
|
||||
console.log(stdout)
|
||||
console.error(stderr)
|
||||
if (error) {
|
||||
return done(error)
|
||||
exec(
|
||||
'CONNECT_DELAY=1 node scripts/convert_archived_state.js',
|
||||
(error, stdout, stderr) => {
|
||||
console.log(stdout)
|
||||
console.error(stderr)
|
||||
if (error) {
|
||||
return done(error)
|
||||
}
|
||||
done()
|
||||
}
|
||||
done()
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
describe('main method', function() {
|
||||
|
|
Loading…
Add table
Reference in a new issue