Merge pull request #3009 from overleaf/jpa-fix-flaky-locking-in-tests

[misc] ProjectStructureMongoLockTest: eventually restore locking timeout

GitOrigin-RevId: 6c139edb0f6e37775c459a50a71dd90802e366fc
This commit is contained in:
Paulo Jorge Reis 2020-07-16 11:10:13 +01:00 committed by Copybot
parent 3660a98fd3
commit ffc5c4be8f

View file

@ -32,6 +32,14 @@ const _ = require('lodash')
describe('ProjectStructureMongoLock', function() {
describe('whilst a project lock is taken', function() {
let oldMaxLockWaitTime
before(function() {
oldMaxLockWaitTime = LockManager.MAX_LOCK_WAIT_TIME
})
after(function() {
LockManager.MAX_LOCK_WAIT_TIME = oldMaxLockWaitTime
})
beforeEach(function(done) {
// We want to instantly fail if the lock is taken
LockManager.MAX_LOCK_WAIT_TIME = 1