From 6f3d68ccbd140eb271a0583fc58e5f539c39b985 Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 7 Sep 2023 11:35:16 -0400 Subject: [PATCH] check connection preloads keys module for reliable measurement --- src/main/js/common/MoneroRpcConnection.js | 5 +++-- src/test/utils/TestUtils.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/js/common/MoneroRpcConnection.js b/src/main/js/common/MoneroRpcConnection.js index 24f60af19..395b0430f 100644 --- a/src/main/js/common/MoneroRpcConnection.js +++ b/src/main/js/common/MoneroRpcConnection.js @@ -148,10 +148,11 @@ class MoneroRpcConnection { /** * Check the connection status to update isOnline, isAuthenticated, and response time. * - * @param {int} timeoutInMs - maximum response time before considered offline + * @param {int} timeoutMs - maximum response time before considered offline * @return {Promise} true if there is a change in status, false otherwise */ - async checkConnection(timeoutInMs) { + async checkConnection(timeoutMs) { + await LibraryUtils.loadKeysModule(); // cache wasm for binary request let isOnlineBefore = this._isOnline; let isAuthenticatedBefore = this._isAuthenticated; let startTime = Date.now(); diff --git a/src/test/utils/TestUtils.js b/src/test/utils/TestUtils.js index 3d9fa76c1..d0933f9f2 100644 --- a/src/test/utils/TestUtils.js +++ b/src/test/utils/TestUtils.js @@ -315,7 +315,7 @@ TestUtils.WALLET_TX_TRACKER = new WalletTxTracker(); // used to track wallet txs TestUtils.PROXY_TO_WORKER = true; TestUtils.SYNC_PERIOD_IN_MS = 5000; // period between wallet syncs in milliseconds TestUtils.OFFLINE_SERVER_URI = "offline_server_uri"; // dummy server uri to remain offline because wallet2 connects to default if not given -TestUtils.AUTO_CONNECT_TIMEOUT_MS = 1000; +TestUtils.AUTO_CONNECT_TIMEOUT_MS = 2000; // monero-wallet-rpc process management TestUtils.WALLET_RPC_PORT_START = 28084;