@@ -25,6 +25,11 @@ import sharedNeo4j from './internal/shared-neo4j'
25
25
26
26
describe ( '#integration stress tests' , ( ) => {
27
27
const TEST_MODES = {
28
+ fastest : {
29
+ commandsCount : 10000 ,
30
+ parallelism : 24 ,
31
+ maxRunTimeMs : 3 * 60000 // 3 minutes
32
+ } ,
28
33
fast : {
29
34
commandsCount : 5000 ,
30
35
parallelism : 8 ,
@@ -44,7 +49,7 @@ describe('#integration stress tests', () => {
44
49
const TEST_MODE = modeFromEnvOrDefault ( 'STRESS_TEST_MODE' )
45
50
const DATABASE_URI = fromEnvOrDefault (
46
51
'STRESS_TEST_DATABASE_URI' ,
47
- `bolt ://${ sharedNeo4j . hostname } `
52
+ `${ sharedNeo4j . scheme } ://${ sharedNeo4j . hostname } : ${ sharedNeo4j . port } `
48
53
)
49
54
50
55
const USERNAME = fromEnvOrDefault (
@@ -57,10 +62,11 @@ describe('#integration stress tests', () => {
57
62
)
58
63
59
64
function isRemoteCluster ( ) {
60
- return (
61
- fromEnvOrDefault ( 'STRESS_TEST_DATABASE_URI' ) !== undefined &&
62
- fromEnvOrDefault ( 'STRESS_TEST_DATABASE_URI' ) !== undefined
63
- )
65
+ return fromEnvOrDefault ( 'STRESS_TEST_DATABASE_URI' ) !== undefined
66
+ }
67
+
68
+ function isCluster ( ) {
69
+ return sharedNeo4j . cluster || isRemoteCluster ( )
64
70
}
65
71
66
72
const LOGGING_ENABLED = fromEnvOrDefault ( 'STRESS_TEST_LOGGING_ENABLED' , false )
@@ -128,19 +134,27 @@ describe('#integration stress tests', () => {
128
134
}
129
135
130
136
function createUniqueCommands ( context ) {
137
+ const clusterSafeCommands = [
138
+ readQueryInTxFunctionCommand ( context ) ,
139
+ readQueryInTxFunctionWithBookmarkCommand ( context ) ,
140
+ writeQueryInTxFunctionWithBookmarkCommand ( context ) ,
141
+ writeQueryInTxFunctionCommand ( context )
142
+ ]
143
+
144
+ if ( isCluster ( ) ) {
145
+ return clusterSafeCommands
146
+ }
147
+
131
148
return [
149
+ ...clusterSafeCommands ,
132
150
readQueryCommand ( context ) ,
133
151
readQueryWithBookmarkCommand ( context ) ,
134
152
readQueryInTxCommand ( context ) ,
135
- readQueryInTxFunctionCommand ( context ) ,
136
153
readQueryInTxWithBookmarkCommand ( context ) ,
137
- readQueryInTxFunctionWithBookmarkCommand ( context ) ,
138
154
writeQueryCommand ( context ) ,
139
155
writeQueryWithBookmarkCommand ( context ) ,
140
156
writeQueryInTxCommand ( context ) ,
141
- writeQueryInTxFunctionCommand ( context ) ,
142
- writeQueryInTxWithBookmarkCommand ( context ) ,
143
- writeQueryInTxFunctionWithBookmarkCommand ( context )
157
+ writeQueryInTxWithBookmarkCommand ( context )
144
158
]
145
159
}
146
160
@@ -243,6 +257,13 @@ describe('#integration stress tests', () => {
243
257
) {
244
258
return callback => {
245
259
const commandId = context . nextCommandId ( )
260
+ if ( isCluster ( ) ) {
261
+ console . log (
262
+ 'SKIPPED: session.run is not safe to in clusters environments'
263
+ )
264
+ callback ( )
265
+ return
266
+ }
246
267
const session = newSession ( context , accessMode , useBookmark )
247
268
const params = paramsSupplier ( )
248
269
@@ -319,6 +340,13 @@ describe('#integration stress tests', () => {
319
340
) {
320
341
return callback => {
321
342
const commandId = context . nextCommandId ( )
343
+ if ( isCluster ( ) ) {
344
+ console . log (
345
+ 'SKIPPED: session.begintTransaction is not safe to in clusters environments'
346
+ )
347
+ callback ( )
348
+ return
349
+ }
322
350
const session = newSession ( context , accessMode , useBookmark )
323
351
const tx = session . beginTransaction ( )
324
352
const params = paramsSupplier ( )
@@ -415,7 +443,7 @@ describe('#integration stress tests', () => {
415
443
function verifyServers ( context ) {
416
444
const routing = DATABASE_URI . indexOf ( 'neo4j' ) === 0
417
445
418
- if ( routing ) {
446
+ if ( routing && isCluster ( ) ) {
419
447
return verifyCausalClusterMembers ( context )
420
448
}
421
449
return verifySingleInstance ( context )
0 commit comments