Skip to content

Commit 6e503a6

Browse files
committed
testkit: fix node count verification
1 parent 11b720e commit 6e503a6

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

test/stress.test.js

Lines changed: 12 additions & 10 deletions
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)