@@ -34,22 +34,18 @@ describe('#integration Bolt V3 API', () => {
34
34
let driver
35
35
let session
36
36
let protocolVersion
37
- let originalTimeout
38
37
39
38
beforeEach ( async ( ) => {
40
39
driver = neo4j . driver (
41
40
`bolt://${ sharedNeo4j . hostname } ` ,
42
41
sharedNeo4j . authToken
43
42
)
44
43
session = driver . session ( )
45
- originalTimeout = jasmine . DEFAULT_TIMEOUT_INTERVAL
46
- jasmine . DEFAULT_TIMEOUT_INTERVAL = 20000
47
44
48
45
protocolVersion = await sharedNeo4j . cleanupAndGetProtocolVersion ( driver )
49
46
} )
50
47
51
48
afterEach ( async ( ) => {
52
- jasmine . DEFAULT_TIMEOUT_INTERVAL = originalTimeout
53
49
await session . close ( )
54
50
await driver . close ( )
55
51
} )
@@ -73,7 +69,7 @@ describe('#integration Bolt V3 API', () => {
73
69
)
74
70
const receivedMetadatas = result . records . map ( r => r . get ( 'metaData' ) )
75
71
expect ( receivedMetadatas ) . toContain ( metadata )
76
- } )
72
+ } , 20000 )
77
73
78
74
it ( 'should set transaction timeout for auto-commit transaction' , async ( ) => {
79
75
if ( ! databaseSupportsBoltV3 ( ) ) {
@@ -104,47 +100,77 @@ describe('#integration Bolt V3 API', () => {
104
100
}
105
101
await tx . rollback ( )
106
102
await otherSession . close ( )
107
- } )
108
-
109
- it ( 'should set transaction metadata with read transaction function' , ( ) =>
110
- testTransactionMetadataWithTransactionFunctions ( true ) )
111
-
112
- it ( 'should set transaction metadata with write transaction function' , ( ) =>
113
- testTransactionMetadataWithTransactionFunctions ( false ) )
114
-
115
- it ( 'should fail auto-commit transaction with metadata when database does not support Bolt V3' , ( ) =>
116
- testAutoCommitTransactionConfigWhenBoltV3NotSupported (
117
- TX_CONFIG_WITH_METADATA
118
- ) )
119
-
120
- it ( 'should fail auto-commit transaction with timeout when database does not support Bolt V3' , ( ) =>
121
- testAutoCommitTransactionConfigWhenBoltV3NotSupported (
122
- TX_CONFIG_WITH_TIMEOUT
123
- ) )
124
-
125
- it ( 'should fail read transaction function with metadata when database does not support Bolt V3' , ( ) =>
126
- testTransactionFunctionConfigWhenBoltV3NotSupported (
127
- true ,
128
- TX_CONFIG_WITH_METADATA
129
- ) )
130
-
131
- it ( 'should fail read transaction function with timeout when database does not support Bolt V3' , ( ) =>
132
- testTransactionFunctionConfigWhenBoltV3NotSupported (
133
- true ,
134
- TX_CONFIG_WITH_TIMEOUT
135
- ) )
136
-
137
- it ( 'should fail write transaction function with metadata when database does not support Bolt V3' , ( ) =>
138
- testTransactionFunctionConfigWhenBoltV3NotSupported (
139
- false ,
140
- TX_CONFIG_WITH_METADATA
141
- ) )
142
-
143
- it ( 'should fail write transaction function with timeout when database does not support Bolt V3' , ( ) =>
144
- testTransactionFunctionConfigWhenBoltV3NotSupported (
145
- false ,
146
- TX_CONFIG_WITH_TIMEOUT
147
- ) )
103
+ } , 20000 )
104
+
105
+ it (
106
+ 'should set transaction metadata with read transaction function' ,
107
+ ( ) => testTransactionMetadataWithTransactionFunctions ( true ) ,
108
+ 20000
109
+ )
110
+
111
+ it (
112
+ 'should set transaction metadata with write transaction function' ,
113
+ ( ) => testTransactionMetadataWithTransactionFunctions ( false ) ,
114
+ 20000
115
+ )
116
+
117
+ it (
118
+ 'should fail auto-commit transaction with metadata when database does not support Bolt V3' ,
119
+ ( ) =>
120
+ testAutoCommitTransactionConfigWhenBoltV3NotSupported (
121
+ TX_CONFIG_WITH_METADATA
122
+ ) ,
123
+ 20000
124
+ )
125
+
126
+ it (
127
+ 'should fail auto-commit transaction with timeout when database does not support Bolt V3' ,
128
+ ( ) =>
129
+ testAutoCommitTransactionConfigWhenBoltV3NotSupported (
130
+ TX_CONFIG_WITH_TIMEOUT
131
+ ) ,
132
+ 20000
133
+ )
134
+
135
+ it (
136
+ 'should fail read transaction function with metadata when database does not support Bolt V3' ,
137
+ ( ) =>
138
+ testTransactionFunctionConfigWhenBoltV3NotSupported (
139
+ true ,
140
+ TX_CONFIG_WITH_METADATA
141
+ ) ,
142
+ 20000
143
+ )
144
+
145
+ it (
146
+ 'should fail read transaction function with timeout when database does not support Bolt V3' ,
147
+ ( ) =>
148
+ testTransactionFunctionConfigWhenBoltV3NotSupported (
149
+ true ,
150
+ TX_CONFIG_WITH_TIMEOUT
151
+ ) ,
152
+ 20000
153
+ )
154
+
155
+ it (
156
+ 'should fail write transaction function with metadata when database does not support Bolt V3' ,
157
+ ( ) =>
158
+ testTransactionFunctionConfigWhenBoltV3NotSupported (
159
+ false ,
160
+ TX_CONFIG_WITH_METADATA
161
+ ) ,
162
+ 20000
163
+ )
164
+
165
+ it (
166
+ 'should fail write transaction function with timeout when database does not support Bolt V3' ,
167
+ ( ) =>
168
+ testTransactionFunctionConfigWhenBoltV3NotSupported (
169
+ false ,
170
+ TX_CONFIG_WITH_TIMEOUT
171
+ ) ,
172
+ 20000
173
+ )
148
174
149
175
it ( 'should set transaction metadata for explicit transactions' , async ( ) => {
150
176
if ( ! databaseSupportsBoltV3 ( ) || ! databaseSupportsListTransaction ( ) ) {
@@ -165,7 +191,7 @@ describe('#integration Bolt V3 API', () => {
165
191
expect ( receivedMetadatas ) . toContain ( metadata )
166
192
167
193
await tx . commit ( )
168
- } )
194
+ } , 20000 )
169
195
170
196
it ( 'should set transaction timeout for explicit transactions' , async ( ) => {
171
197
if ( ! databaseSupportsBoltV3 ( ) ) {
@@ -198,65 +224,89 @@ describe('#integration Bolt V3 API', () => {
198
224
199
225
await otherTx . rollback ( )
200
226
await otherSession . close ( )
201
- } )
202
-
203
- it ( 'should fail to run in explicit transaction with metadata when database does not support Bolt V3' , ( ) =>
204
- testRunInExplicitTransactionWithConfigWhenBoltV3NotSupported (
205
- TX_CONFIG_WITH_METADATA
206
- ) )
207
-
208
- it ( 'should fail to run in explicit transaction with timeout when database does not support Bolt V3' , ( ) =>
209
- testRunInExplicitTransactionWithConfigWhenBoltV3NotSupported (
210
- TX_CONFIG_WITH_TIMEOUT
211
- ) )
212
-
213
- it ( 'should fail to commit explicit transaction with metadata when database does not support Bolt V3' , ( ) =>
214
- testCloseExplicitTransactionWithConfigWhenBoltV3NotSupported (
215
- true ,
216
- TX_CONFIG_WITH_METADATA
217
- ) )
218
-
219
- it ( 'should fail to commit explicit transaction with timeout when database does not support Bolt V3' , ( ) =>
220
- testCloseExplicitTransactionWithConfigWhenBoltV3NotSupported (
221
- true ,
222
- TX_CONFIG_WITH_TIMEOUT
223
- ) )
224
-
225
- it ( 'should fail to rollback explicit transaction with metadata when database does not support Bolt V3' , ( ) =>
226
- testCloseExplicitTransactionWithConfigWhenBoltV3NotSupported (
227
- false ,
228
- TX_CONFIG_WITH_METADATA
229
- ) )
230
-
231
- it ( 'should fail to rollback explicit transaction with timeout when database does not support Bolt V3' , ( ) =>
232
- testCloseExplicitTransactionWithConfigWhenBoltV3NotSupported (
233
- false ,
234
- TX_CONFIG_WITH_TIMEOUT
235
- ) )
227
+ } , 20000 )
228
+
229
+ it (
230
+ 'should fail to run in explicit transaction with metadata when database does not support Bolt V3' ,
231
+ ( ) =>
232
+ testRunInExplicitTransactionWithConfigWhenBoltV3NotSupported (
233
+ TX_CONFIG_WITH_METADATA
234
+ ) ,
235
+ 20000
236
+ )
237
+
238
+ it (
239
+ 'should fail to run in explicit transaction with timeout when database does not support Bolt V3' ,
240
+ ( ) =>
241
+ testRunInExplicitTransactionWithConfigWhenBoltV3NotSupported (
242
+ TX_CONFIG_WITH_TIMEOUT
243
+ ) ,
244
+ 20000
245
+ )
246
+
247
+ it (
248
+ 'should fail to commit explicit transaction with metadata when database does not support Bolt V3' ,
249
+ ( ) =>
250
+ testCloseExplicitTransactionWithConfigWhenBoltV3NotSupported (
251
+ true ,
252
+ TX_CONFIG_WITH_METADATA
253
+ ) ,
254
+ 20000
255
+ )
256
+
257
+ it (
258
+ 'should fail to commit explicit transaction with timeout when database does not support Bolt V3' ,
259
+ ( ) =>
260
+ testCloseExplicitTransactionWithConfigWhenBoltV3NotSupported (
261
+ true ,
262
+ TX_CONFIG_WITH_TIMEOUT
263
+ ) ,
264
+ 20000
265
+ )
266
+
267
+ it (
268
+ 'should fail to rollback explicit transaction with metadata when database does not support Bolt V3' ,
269
+ ( ) =>
270
+ testCloseExplicitTransactionWithConfigWhenBoltV3NotSupported (
271
+ false ,
272
+ TX_CONFIG_WITH_METADATA
273
+ ) ,
274
+ 20000
275
+ )
276
+
277
+ it (
278
+ 'should fail to rollback explicit transaction with timeout when database does not support Bolt V3' ,
279
+ ( ) =>
280
+ testCloseExplicitTransactionWithConfigWhenBoltV3NotSupported (
281
+ false ,
282
+ TX_CONFIG_WITH_TIMEOUT
283
+ ) ,
284
+ 20000
285
+ )
236
286
237
287
it ( 'should fail to run auto-commit transaction with invalid timeout' , ( ) => {
238
288
INVALID_TIMEOUT_VALUES . forEach ( invalidValue =>
239
289
expect ( ( ) =>
240
290
session . run ( 'RETURN $x' , { x : 42 } , { timeout : invalidValue } )
241
291
) . toThrow ( )
242
292
)
243
- } )
293
+ } , 20000 )
244
294
245
295
it ( 'should fail to run auto-commit transaction with invalid metadata' , ( ) => {
246
296
INVALID_METADATA_VALUES . forEach ( invalidValue =>
247
297
expect ( ( ) =>
248
298
session . run ( 'RETURN $x' , { x : 42 } , { metadata : invalidValue } )
249
299
) . toThrow ( )
250
300
)
251
- } )
301
+ } , 20000 )
252
302
253
303
it ( 'should fail to begin explicit transaction with invalid timeout' , ( ) => {
254
304
INVALID_TIMEOUT_VALUES . forEach ( invalidValue =>
255
305
expect ( ( ) =>
256
306
session . beginTransaction ( { timeout : invalidValue } )
257
307
) . toThrow ( )
258
308
)
259
- } )
309
+ } , 20000 )
260
310
261
311
it ( 'should fail to begin explicit transaction with invalid metadata' , ( ) => {
262
312
INVALID_METADATA_VALUES . forEach ( invalidValue =>
@@ -274,7 +324,7 @@ describe('#integration Bolt V3 API', () => {
274
324
} )
275
325
) . toThrow ( )
276
326
)
277
- } )
327
+ } , 20000 )
278
328
279
329
it ( 'should fail to run read transaction function with invalid metadata' , ( ) => {
280
330
INVALID_METADATA_VALUES . forEach ( invalidValue =>
@@ -294,7 +344,7 @@ describe('#integration Bolt V3 API', () => {
294
344
} )
295
345
) . toThrow ( )
296
346
)
297
- } )
347
+ } , 20000 )
298
348
299
349
it ( 'should fail to run write transaction function with invalid metadata' , ( ) => {
300
350
INVALID_METADATA_VALUES . forEach ( invalidValue =>
@@ -304,7 +354,7 @@ describe('#integration Bolt V3 API', () => {
304
354
} )
305
355
) . toThrow ( )
306
356
)
307
- } )
357
+ } , 20000 )
308
358
309
359
it ( 'should use bookmarks for auto commit transactions' , async ( ) => {
310
360
if ( ! databaseSupportsBoltV3 ( ) ) {
@@ -333,7 +383,7 @@ describe('#integration Bolt V3 API', () => {
333
383
expect ( bookmark3 ) . not . toEqual ( initialBookmark )
334
384
expect ( bookmark3 ) . not . toEqual ( bookmark1 )
335
385
expect ( bookmark3 ) . not . toEqual ( bookmark2 )
336
- } )
386
+ } , 20000 )
337
387
338
388
it ( 'should use bookmarks for auto commit and explicit transactions' , async ( ) => {
339
389
if ( ! databaseSupportsBoltV3 ( ) ) {
@@ -366,7 +416,7 @@ describe('#integration Bolt V3 API', () => {
366
416
expect ( bookmark3 ) . not . toEqual ( initialBookmark )
367
417
expect ( bookmark3 ) . not . toEqual ( bookmark1 )
368
418
expect ( bookmark3 ) . not . toEqual ( bookmark2 )
369
- } )
419
+ } , 20000 )
370
420
371
421
it ( 'should use bookmarks for auto commit transactions and transaction functions' , async ( ) => {
372
422
if ( ! databaseSupportsBoltV3 ( ) ) {
@@ -395,7 +445,7 @@ describe('#integration Bolt V3 API', () => {
395
445
expect ( bookmark3 ) . not . toEqual ( initialBookmark )
396
446
expect ( bookmark3 ) . not . toEqual ( bookmark1 )
397
447
expect ( bookmark3 ) . not . toEqual ( bookmark2 )
398
- } )
448
+ } , 20000 )
399
449
400
450
async function testTransactionMetadataWithTransactionFunctions ( read ) {
401
451
if ( ! databaseSupportsBoltV3 ( ) || ! databaseSupportsListTransaction ( ) ) {
0 commit comments