From 22a3674bebbcd84c620a469a2ab14d36cd15d3b9 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 6 Feb 2020 11:31:42 +1100 Subject: [PATCH] api_test: Fix bitcoind/parity log wait --- api_tests/lib/log_reader.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api_tests/lib/log_reader.ts b/api_tests/lib/log_reader.ts index edf495f9b5..5ae8769d0b 100644 --- a/api_tests/lib/log_reader.ts +++ b/api_tests/lib/log_reader.ts @@ -4,8 +4,13 @@ export class LogReader { private tail: Tail; constructor(logFile: string) { - const options = { fromBeginning: true, follow: true }; + // By default tail uses `fs.watch` that watches the inode + // However, it looks like on Mac OS, the inode get changed at some point + // To counter that then we use `fs.watchFile` which is actually considered + // less efficient. Hence only using it on Mac. + const useWatchFile = process.platform === "darwin" ? true : false; + const options = { fromBeginning: true, follow: true, useWatchFile }; this.tail = new Tail(logFile, options); }