(fn)
| 1854 | } |
| 1855 | |
| 1856 | function setupRaceConditionInReplication(fn) { |
| 1857 | const bulkUpdate = TargetModel.bulkUpdate; |
| 1858 | TargetModel.bulkUpdate = function(data, options, cb) { |
| 1859 | // simulate the situation when a 3rd party modifies the database |
| 1860 | // while a replication run is in progress |
| 1861 | const self = this; |
| 1862 | fn(function(err) { |
| 1863 | if (err) return cb(err); |
| 1864 | |
| 1865 | bulkUpdate.call(self, data, options, cb); |
| 1866 | }); |
| 1867 | |
| 1868 | // apply the 3rd party modification only once |
| 1869 | TargetModel.bulkUpdate = bulkUpdate; |
| 1870 | }; |
| 1871 | } |
| 1872 | |
| 1873 | function verifyInstanceWasReplicated(source, target, id) { |
| 1874 | return function verify(next) { |
no test coverage detected
searching dependent graphs…