Skip to content

Commit 2eb06f9

Browse files
committed
testkit: verify node count using tx function
1 parent f539b97 commit 2eb06f9

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

test/stress.test.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -428,16 +428,18 @@ describe('#integration stress tests', () => {
428428
const expectedNodeCount = context.createdNodesCount
429429

430430
const session = context.driver.session()
431-
return session.run('MATCH (n) RETURN count(n)').then(result => {
432-
const record = result.records[0]
433-
const count = record.get(0).toNumber()
434-
435-
if (count !== expectedNodeCount) {
436-
throw new Error(
437-
`Unexpected node count: ${count}, expected: ${expectedNodeCount}`
438-
)
439-
}
440-
})
431+
return session
432+
.readTransaction(tx => tx.run('MATCH (n) RETURN count(n)'))
433+
.then(result => {
434+
const record = result.records[0]
435+
const count = record.get(0).toNumber()
436+
437+
if (count !== expectedNodeCount) {
438+
throw new Error(
439+
`Unexpected node count: ${count}, expected: ${expectedNodeCount}`
440+
)
441+
}
442+
})
441443
}
442444

443445
function verifyServers (context) {

0 commit comments

Comments
 (0)