From a2c6828972bb1f7cb85c5efd4d6907ca6ee40025 Mon Sep 17 00:00:00 2001 From: Antonio Barcelos Date: Tue, 13 Jun 2023 15:44:17 +0200 Subject: [PATCH 1/2] Decrease integration tests duration 80% of the integration tests was related to random temporal types tests. Make this tests run in parallel by starting all of them using `setImmediate` function. Since `setImmediate` is not available in browsers, this tests will be skipped on this environment. This is not a issue since these tests paths are already cover by property tests in the `bolt-connection` unit tests suite and in Testkit. --- packages/neo4j-driver/test/temporal-types.test.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/neo4j-driver/test/temporal-types.test.js b/packages/neo4j-driver/test/temporal-types.test.js index 92c64a6f5..1bcc4b8a6 100644 --- a/packages/neo4j-driver/test/temporal-types.test.js +++ b/packages/neo4j-driver/test/temporal-types.test.js @@ -1403,9 +1403,16 @@ describe('#integration temporal-types', () => { }) function testSendAndReceiveRandomTemporalValues (temporalType, valueGenerator) { + let setImmediate + if (typeof setImmediate !== 'function') { + return + } + for (let i = 0; i < RANDOM_VALUES_TO_TEST; i++) { - it(`should send and receive random ${temporalType} [index=${i}]`, async () => { - await testSendReceiveTemporalValue(valueGenerator()) + setImmediate(() => { + it(`should send and receive random ${temporalType} [index=${i}]`, async () => { + await testSendReceiveTemporalValue(valueGenerator()) + }) }) } } From 8b36d7cf5907b6c21d2da2fb73bc8cfdf5d330b1 Mon Sep 17 00:00:00 2001 From: Antonio Barcelos Date: Tue, 13 Jun 2023 17:03:26 +0200 Subject: [PATCH 2/2] Decrease integration tests duration 80% of the integration tests was related to random temporal types tests. Decrease the number of random test speeds up the process. This is not a issue since these tests paths are already cover by property tests in the bolt-connection unit tests suite and in Testkit. --- packages/neo4j-driver/test/temporal-types.test.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/neo4j-driver/test/temporal-types.test.js b/packages/neo4j-driver/test/temporal-types.test.js index 1bcc4b8a6..39a1132d7 100644 --- a/packages/neo4j-driver/test/temporal-types.test.js +++ b/packages/neo4j-driver/test/temporal-types.test.js @@ -26,7 +26,7 @@ const { temporalUtil: { timeZoneOffsetInSeconds, totalNanoseconds } } = internal -const RANDOM_VALUES_TO_TEST = 2000 +const RANDOM_VALUES_TO_TEST = 500 const MIN_TEMPORAL_ARRAY_LENGTH = 20 const MAX_TEMPORAL_ARRAY_LENGTH = 1000 /** @@ -1403,16 +1403,9 @@ describe('#integration temporal-types', () => { }) function testSendAndReceiveRandomTemporalValues (temporalType, valueGenerator) { - let setImmediate - if (typeof setImmediate !== 'function') { - return - } - for (let i = 0; i < RANDOM_VALUES_TO_TEST; i++) { - setImmediate(() => { - it(`should send and receive random ${temporalType} [index=${i}]`, async () => { - await testSendReceiveTemporalValue(valueGenerator()) - }) + it(`should send and receive random ${temporalType} [index=${i}]`, async () => { + await testSendReceiveTemporalValue(valueGenerator()) }) } }