From c14951cb0efa73aa7013f5790601de7bb7bef181 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 9 Aug 2021 11:58:58 +1000 Subject: [PATCH] Increase timeout for nim-waku starts Took 5 seconds in CI run. --- src/test_utils/log_file.ts | 5 +++-- src/test_utils/nim_waku.ts | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/test_utils/log_file.ts b/src/test_utils/log_file.ts index 70e5f0aca5..4eca0e4bce 100644 --- a/src/test_utils/log_file.ts +++ b/src/test_utils/log_file.ts @@ -13,9 +13,10 @@ import { waitForFile } from './async_fs'; export default async function waitForLine( filepath: string, - logLine: string + logLine: string, + timeout: number ): Promise { - await pTimeout(waitForFile(filepath), 2000); + await pTimeout(waitForFile(filepath), timeout); const options = { fromBeginning: true, diff --git a/src/test_utils/nim_waku.ts b/src/test_utils/nim_waku.ts index 6bf7cc716d..64ee98a460 100644 --- a/src/test_utils/nim_waku.ts +++ b/src/test_utils/nim_waku.ts @@ -135,7 +135,7 @@ export class NimWaku { }); dbg("Waiting to see 'RPC Server started' in nim-waku logs"); - await this.waitForLog('RPC Server started'); + await this.waitForLog('RPC Server started', 10000); dbg('nim-waku node has been started'); } @@ -149,8 +149,8 @@ export class NimWaku { this.process = undefined; } - async waitForLog(msg: string): Promise { - return waitForLine(this.logPath, msg); + async waitForLog(msg: string, timeout: number): Promise { + return waitForLine(this.logPath, msg, timeout); } /** Calls nim-waku2 JSON-RPC API `get_waku_v2_admin_v1_peers` to check