Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

api_test: Fix bitcoind/parity log wait #1994

Merged
merged 1 commit into from
Feb 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion api_tests/lib/log_reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down