From 2163d2ee317857758d5003fb0d4145c9832ae00a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Wed, 14 Jul 2021 12:25:19 +0300 Subject: [PATCH] Add version check for flaky test (#972) --- .../backward_compatible/ClientReconnectTest.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/test/integration/backward_compatible/ClientReconnectTest.js b/test/integration/backward_compatible/ClientReconnectTest.js index 196daad7f..116e32cce 100644 --- a/test/integration/backward_compatible/ClientReconnectTest.js +++ b/test/integration/backward_compatible/ClientReconnectTest.js @@ -18,6 +18,7 @@ const { expect } = require('chai'); const RC = require('../RC'); const { Client } = require('../../../'); +const { markClientVersionAtLeast } = require('../../TestUtil'); /** * Basic tests for reconnection to cluster scenarios. @@ -27,9 +28,18 @@ describe('ClientReconnectTest', function () { let cluster; let client; + beforeEach(function () { + client = undefined; + cluster = undefined; + }); + afterEach(async function () { - await client.shutdown(); - await RC.terminateCluster(cluster.id); + if (client) { + await client.shutdown(); + } + if (cluster) { + await RC.terminateCluster(cluster.id); + } }); it('member restarts, while map.put in progress', async function () { @@ -80,6 +90,9 @@ describe('ClientReconnectTest', function () { }); it('create proxy while member is down, member comes back', async function () { + // Before https://github.com/hazelcast/hazelcast-nodejs-client/pull/704, this test is flaky. + // https://github.com/hazelcast/hazelcast-nodejs-client/issues/658#issuecomment-868970776 + markClientVersionAtLeast(this, '4.0.2'); cluster = await RC.createCluster(null, null); const member = await RC.startMember(cluster.id); client = await Client.newHazelcastClient({