Skip to content

Commit

Permalink
remove tests for jitdb.status that are flaky
Browse files Browse the repository at this point in the history
  • Loading branch information
staltz committed Apr 20, 2022
1 parent 2386b50 commit 2d40781
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions test/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ prepareAndRunTest('Base', dir, (t, db, raf) => {
})

prepareAndRunTest('Update index', dir, (t, db, raf) => {
t.plan(9)
t.plan(7)
t.timeoutAfter(5000)
const msg = { type: 'post', text: 'Testing!' }
let state = validate.initial()
Expand All @@ -183,19 +183,13 @@ prepareAndRunTest('Update index', dir, (t, db, raf) => {
}

const expectedIndexingActive = [0, 1 /* seq */, 0, 1 /* type_post */, 0]
const expectedStatus = [{ seq: -1, timestamp: -1, sequence: -1 }, {}]
db.status((stats) => {
t.deepEqual(stats, expectedStatus.shift(), 'status matches')
if (!expectedStatus.length && !expectedIndexingActive.length) t.end()
})

addMsg(state.queue[0].value, raf, (err, msg1) => {
db.all(typeQuery, 0, false, false, 'declared', (err, results) => {
t.equal(results.length, 1, '1 message')

db.indexingActive((x) => {
t.equals(x, expectedIndexingActive.shift(), 'indexingActive matches')
if (!expectedStatus.length && !expectedIndexingActive.length) t.end()
})

addMsg(state.queue[1].value, raf, (err, msg1) => {
Expand Down

0 comments on commit 2d40781

Please sign in to comment.