Skip to content

Commit

Permalink
fix another test edge condition
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonad committed Feb 7, 2020
1 parent 144fb94 commit 0aa3dc4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/y-redis.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ export const testPerformance = async tc => {
}
{
const redisPersistence = new RedisPersistence()
const doc = new Y.Doc()
const persistenceDoc = redisPersistence.bindState(tc.testName, doc)
await t.measureTime(`read ${N / 1000}k updates`, async () => {
const doc = new Y.Doc()
await redisPersistence.bindState(tc.testName, doc).synced
await persistenceDoc.synced
t.assert(doc.getArray('test').length === N)
return undefined
})
Expand Down Expand Up @@ -188,9 +189,11 @@ export const testPerformanceConcurrent = async tc => {
}
{
const redisPersistence = new RedisPersistence()
const doc = new Y.Doc()
const persistenceDoc = redisPersistence.bindState(tc.testName, doc)

await t.measureTime(`read ${N / 1000}k updates`, async () => {
const doc = new Y.Doc()
await redisPersistence.bindState(tc.testName, doc).synced
await persistenceDoc.synced
t.assert(doc.getArray('test').length === N)
return undefined
})
Expand Down

0 comments on commit 0aa3dc4

Please sign in to comment.