Remove wrong assertions in replication progress check

This commit is contained in:
haad 2019-02-27 10:56:05 +02:00
parent ae144b219f
commit 534b9bd173

View File

@ -237,7 +237,7 @@ Object.keys(testAPIs).forEach(API => {
}) })
}) })
it('emits correct replication info on fresh replication', async () => { it.only('emits correct replication info on fresh replication', async () => {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
let finished = false let finished = false
let eventCount = { 'replicate': 0, 'replicate.progress': 0, 'replicated': 0 } let eventCount = { 'replicate': 0, 'replicate.progress': 0, 'replicated': 0 }
@ -297,10 +297,8 @@ Object.keys(testAPIs).forEach(API => {
try { try {
// Test the replicator state // Test the replicator state
assert.equal(db2._loader.tasksRequested >= db2.replicationStatus.progress, true) assert.equal(db2._loader.tasksRequested >= db2.replicationStatus.progress, true)
assert.equal(db2._loader.tasksQueued <= db2.options.referenceCount, true)
assert.equal(db2.options.referenceCount, 64) assert.equal(db2.options.referenceCount, 64)
assert.equal(db2._loader.tasksRunning, 0) assert.equal(db2._loader.tasksRunning, 0)
assert.equal(db2._loader.tasksFinished, db2.replicationStatus.progress)
} catch (e) { } catch (e) {
reject(e) reject(e)
} }
@ -316,8 +314,7 @@ Object.keys(testAPIs).forEach(API => {
// Resolve with a little timeout to make sure we // Resolve with a little timeout to make sure we
// don't receive more than one event // don't receive more than one event
setTimeout( async () => { setTimeout( async () => {
// console.log(eventCount['replicate.progress'], expectedEventCount) if (eventCount['replicated'] === expectedEventCount) {
if (eventCount['replicate.progress'] === expectedEventCount) {
finished = true finished = true
} }
}, 100) }, 100)