Skip to content

Commit ac20a05

Browse files
committed
Waiting bookmarks be propagated
1 parent 1c0959b commit ac20a05

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/neo4j-driver/test/internal/shared-neo4j.js

+13
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,25 @@ async function cleanupAndGetProtocolVersion (driver) {
314314
const result = await session.writeTransaction(tx =>
315315
tx.run('MATCH (n) DETACH DELETE n')
316316
)
317+
await checkBookmarkPropagated(driver, session.lastBookmark())
317318
return result.summary.server.protocolVersion
318319
} finally {
319320
await session.close()
320321
}
321322
}
322323

324+
async function checkBookmarkPropagated (driver, bookmarks) {
325+
const session = driver.session({
326+
defaultAccessMode: neo4j.session.READ,
327+
bookmarks
328+
})
329+
try {
330+
return await session.readTransaction(tx => tx.run('RETURN 1 AS n'))
331+
} finally {
332+
await session.close()
333+
}
334+
}
335+
323336
async function getEdition (driver) {
324337
const session = driver.session({ defaultAccessMode: neo4j.session.READ })
325338
try {

0 commit comments

Comments
 (0)