@@ -74,7 +74,10 @@ export default async function execute () {
74
74
neo4j . auth . basic ( USERNAME , PASSWORD ) ,
75
75
config
76
76
)
77
- const protocolVersion = await sharedNeo4j . cleanupAndGetProtocolVersion ( driver )
77
+ const [
78
+ protocolVersion ,
79
+ bookmarks
80
+ ] = await sharedNeo4j . cleanupAndGetProtocolVersionAndBookmark ( driver )
78
81
console . time ( 'Basic-stress-test' )
79
82
const printStats = ( ) => {
80
83
console . timeEnd ( 'Basic-stress-test' )
@@ -83,7 +86,12 @@ export default async function execute () {
83
86
console . log ( 'Write statistics: ' , context . writeServersWithQueryCount )
84
87
}
85
88
86
- const context = new Context ( driver , LOGGING_ENABLED , protocolVersion )
89
+ const context = new Context (
90
+ driver ,
91
+ LOGGING_ENABLED ,
92
+ protocolVersion ,
93
+ bookmarks
94
+ )
87
95
88
96
try {
89
97
await runWhileNotTimeout ( async ( ) => {
@@ -525,10 +533,10 @@ function noParams () {
525
533
}
526
534
527
535
function newSession ( context , accessMode , useBookmark ) {
528
- if ( useBookmark ) {
536
+ if ( useBookmark || isCluster ( ) ) {
529
537
return context . driver . session ( {
530
538
defaultAccessMode : accessMode ,
531
- bookmarks : [ context . bookmark ]
539
+ bookmarks : context . bookmark
532
540
} )
533
541
}
534
542
return context . driver . session ( { defaultAccessMode : accessMode } )
@@ -556,9 +564,9 @@ function arraysEqual (array1, array2) {
556
564
}
557
565
558
566
class Context {
559
- constructor ( driver , loggingEnabled , protocolVersion ) {
567
+ constructor ( driver , loggingEnabled , protocolVersion , bookmark ) {
560
568
this . driver = driver
561
- this . bookmark = null
569
+ this . bookmark = bookmark
562
570
this . createdNodesCount = 0
563
571
this . _commandIdCouter = 0
564
572
this . _loggingEnabled = loggingEnabled
0 commit comments