From 03db8a7348f13cb27caec83ec6160bf2baad616f Mon Sep 17 00:00:00 2001 From: Alexey Yarmosh Date: Tue, 16 Apr 2024 18:14:11 +0200 Subject: [PATCH] fix: e2e probe logs after restart --- test/e2e/docker.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/e2e/docker.ts b/test/e2e/docker.ts index 5e380887..d0882b89 100644 --- a/test/e2e/docker.ts +++ b/test/e2e/docker.ts @@ -8,6 +8,8 @@ const logger = scopedLogger('docker-manager'); class DockerManager { docker: Docker; + private lastLogTimestamp: number = 0; + constructor () { this.docker = new Docker(); } @@ -96,6 +98,7 @@ class DockerManager { } await container.start({}); + await this.attachLogs(container); } private async attachLogs (container: Docker.Container) { @@ -103,7 +106,10 @@ class DockerManager { follow: true, stdout: true, stderr: true, + since: this.lastLogTimestamp, }); + stream.on('close', () => this.lastLogTimestamp = Math.floor(Date.now() / 1000)); + container.modem.demuxStream(stream, process.stdout, process.stderr); }