mirror of https://codeberg.org/pzp/pzp-db.git
Skip really long test in ci
This commit is contained in:
parent
b4190b0ae2
commit
f93082f38d
|
@ -141,51 +141,57 @@ test('Log deletes', async (t) => {
|
||||||
await p(log.close)()
|
await p(log.close)()
|
||||||
})
|
})
|
||||||
|
|
||||||
await t.test('Many deleted records', { timeout: 3 * 60e3 }, async (t) => {
|
await t.test(
|
||||||
const file = '/tmp/aaol-test-delete-many' + Date.now() + '.log'
|
'Many deleted records',
|
||||||
const log = Log(file, { blockSize: 64 * 1024 })
|
{ timeout: 3 * 60e3, skip: !!process.env.CI },
|
||||||
|
async (t) => {
|
||||||
|
const file = '/tmp/aaol-test-delete-many' + Date.now() + '.log'
|
||||||
|
const log = Log(file, { blockSize: 64 * 1024 })
|
||||||
|
|
||||||
const TOTAL = 100000
|
const TOTAL = 100000
|
||||||
const offsets = []
|
const offsets = []
|
||||||
const logAppend = p(log.append)
|
const logAppend = p(log.append)
|
||||||
if (process.env.VERBOSE) console.time('append ' + TOTAL)
|
if (process.env.VERBOSE) console.time('append ' + TOTAL)
|
||||||
for (let i = 0; i < TOTAL; i += 1) {
|
for (let i = 0; i < TOTAL; i += 1) {
|
||||||
const offset = await logAppend(Buffer.from(`hello ${i}`))
|
const offset = await logAppend(Buffer.from(`hello ${i}`))
|
||||||
offsets.push(offset)
|
offsets.push(offset)
|
||||||
}
|
}
|
||||||
assert('appended records')
|
assert('appended records')
|
||||||
if (process.env.VERBOSE) console.timeEnd('append ' + TOTAL)
|
if (process.env.VERBOSE) console.timeEnd('append ' + TOTAL)
|
||||||
|
|
||||||
await p(log.onDrain)()
|
await p(log.onDrain)()
|
||||||
|
|
||||||
const logDel = p(log.del)
|
const logDel = p(log.del)
|
||||||
if (process.env.VERBOSE) console.time('delete ' + TOTAL / 2)
|
if (process.env.VERBOSE) console.time('delete ' + TOTAL / 2)
|
||||||
for (let i = 0; i < TOTAL; i += 2) {
|
for (let i = 0; i < TOTAL; i += 2) {
|
||||||
await logDel(offsets[i])
|
await logDel(offsets[i])
|
||||||
}
|
}
|
||||||
if (process.env.VERBOSE) console.timeEnd('delete ' + TOTAL / 2)
|
if (process.env.VERBOSE) console.timeEnd('delete ' + TOTAL / 2)
|
||||||
assert('deleted messages')
|
assert('deleted messages')
|
||||||
|
|
||||||
await p(log.onOverwritesFlushed)()
|
await p(log.onOverwritesFlushed)()
|
||||||
|
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
let i = 0
|
let i = 0
|
||||||
log.scan(
|
log.scan(
|
||||||
(offset, rec, length) => {
|
(offset, rec, length) => {
|
||||||
if (i % 2 === 0) {
|
if (i % 2 === 0) {
|
||||||
if (rec !== null) assert.fail('record ' + i + ' should be deleted')
|
if (rec !== null)
|
||||||
} else {
|
assert.fail('record ' + i + ' should be deleted')
|
||||||
if (rec === null) assert.fail('record ' + i + ' should be present')
|
} else {
|
||||||
|
if (rec === null)
|
||||||
|
assert.fail('record ' + i + ' should be present')
|
||||||
|
}
|
||||||
|
i += 1
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
assert.ifError(err)
|
||||||
|
resolve()
|
||||||
}
|
}
|
||||||
i += 1
|
)
|
||||||
},
|
})
|
||||||
(err) => {
|
|
||||||
assert.ifError(err)
|
|
||||||
resolve()
|
|
||||||
}
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
await p(log.close)()
|
await p(log.close)()
|
||||||
})
|
}
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue