Przeglądaj źródła

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

[misc] ProjectStructureMongoLockTest: eventually restore locking timeout

GitOrigin-RevId: 6c139edb0f6e37775c459a50a71dd90802e366fc
Paulo Jorge Reis 6 lat temu
rodzic
commit
ffc5c4be8f

+ 8 - 0
services/web/test/acceptance/src/ProjectStructureMongoLockTest.js

@@ -32,6 +32,14 @@ const _ = require('lodash')
 
 
 describe('ProjectStructureMongoLock', function() {
 describe('ProjectStructureMongoLock', function() {
   describe('whilst a project lock is taken', 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) {
     beforeEach(function(done) {
       // We want to instantly fail if the lock is taken
       // We want to instantly fail if the lock is taken
       LockManager.MAX_LOCK_WAIT_TIME = 1
       LockManager.MAX_LOCK_WAIT_TIME = 1