@@ -25,6 +25,11 @@ import sharedNeo4j from './internal/shared-neo4j'
2525
2626describe ( '#integration stress tests' , ( ) => {
2727 const TEST_MODES = {
28+ fastest : {
29+ commandsCount : 10000 ,
30+ parallelism : 24 ,
31+ maxRunTimeMs : 3 * 60000 // 3 minutes
32+ } ,
2833 fast : {
2934 commandsCount : 5000 ,
3035 parallelism : 8 ,
@@ -44,7 +49,7 @@ describe('#integration stress tests', () => {
4449 const TEST_MODE = modeFromEnvOrDefault ( 'STRESS_TEST_MODE' )
4550 const DATABASE_URI = fromEnvOrDefault (
4651 'STRESS_TEST_DATABASE_URI' ,
47- `bolt ://${ sharedNeo4j . hostname } `
52+ `${ sharedNeo4j . scheme } ://${ sharedNeo4j . hostname } : ${ sharedNeo4j . port } `
4853 )
4954
5055 const USERNAME = fromEnvOrDefault (
@@ -57,10 +62,11 @@ describe('#integration stress tests', () => {
5762 )
5863
5964 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 ( )
6470 }
6571
6672 const LOGGING_ENABLED = fromEnvOrDefault ( 'STRESS_TEST_LOGGING_ENABLED' , false )
@@ -128,19 +134,27 @@ describe('#integration stress tests', () => {
128134 }
129135
130136 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+
131148 return [
149+ ...clusterSafeCommands ,
132150 readQueryCommand ( context ) ,
133151 readQueryWithBookmarkCommand ( context ) ,
134152 readQueryInTxCommand ( context ) ,
135- readQueryInTxFunctionCommand ( context ) ,
136153 readQueryInTxWithBookmarkCommand ( context ) ,
137- readQueryInTxFunctionWithBookmarkCommand ( context ) ,
138154 writeQueryCommand ( context ) ,
139155 writeQueryWithBookmarkCommand ( context ) ,
140156 writeQueryInTxCommand ( context ) ,
141- writeQueryInTxFunctionCommand ( context ) ,
142- writeQueryInTxWithBookmarkCommand ( context ) ,
143- writeQueryInTxFunctionWithBookmarkCommand ( context )
157+ writeQueryInTxWithBookmarkCommand ( context )
144158 ]
145159 }
146160
@@ -243,6 +257,13 @@ describe('#integration stress tests', () => {
243257 ) {
244258 return callback => {
245259 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+ }
246267 const session = newSession ( context , accessMode , useBookmark )
247268 const params = paramsSupplier ( )
248269
@@ -319,6 +340,13 @@ describe('#integration stress tests', () => {
319340 ) {
320341 return callback => {
321342 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+ }
322350 const session = newSession ( context , accessMode , useBookmark )
323351 const tx = session . beginTransaction ( )
324352 const params = paramsSupplier ( )
@@ -415,7 +443,7 @@ describe('#integration stress tests', () => {
415443 function verifyServers ( context ) {
416444 const routing = DATABASE_URI . indexOf ( 'neo4j' ) === 0
417445
418- if ( routing ) {
446+ if ( routing && isCluster ( ) ) {
419447 return verifyCausalClusterMembers ( context )
420448 }
421449 return verifySingleInstance ( context )
0 commit comments