From e263ea68404b58121fe977b7a7117a2cd2c129b9 Mon Sep 17 00:00:00 2001 From: Simon Woolf Date: Thu, 19 Jan 2023 12:19:38 +0000 Subject: [PATCH] init_usetokenauth_defaulttokenparams_wildcard test: increase ttl to fix race with a 12s ttl, realtime was asking the lib to start a reauth as soon as it connected. With unlucky timings, the original token details could be cleared just before the test code looked at it. --- test/realtime/init.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/realtime/init.test.js b/test/realtime/init.test.js index 7b8d75ce15..9a44c2ecfc 100644 --- a/test/realtime/init.test.js +++ b/test/realtime/init.test.js @@ -130,7 +130,7 @@ define(['ably', 'shared_helper', 'chai'], function (Ably, helper, chai) { realtime = helper.AblyRealtime({ key: keyStr, useTokenAuth: true, - defaultTokenParams: { clientId: '*', ttl: 12345 }, + defaultTokenParams: { clientId: '*', ttl: 123456 }, }); expect(realtime.auth.clientId).to.equal(undefined); realtime.connection.on('connected', function () { @@ -138,7 +138,7 @@ define(['ably', 'shared_helper', 'chai'], function (Ably, helper, chai) { expect(realtime.auth.tokenDetails.clientId).to.equal('*'); /* auth.clientId now does inherit the value '*' -- RSA7b4 */ expect(realtime.auth.clientId).to.equal('*'); - expect(realtime.auth.tokenDetails.expires - realtime.auth.tokenDetails.issued).to.equal(12345); + expect(realtime.auth.tokenDetails.expires - realtime.auth.tokenDetails.issued).to.equal(123456); } catch (err) { closeAndFinish(done, realtime, err); return;