From 8ccadcb724d30b28d20b321cd7d49f94e6823ad4 Mon Sep 17 00:00:00 2001 From: Mikhail Cheshkov Date: Wed, 15 Jan 2025 00:25:06 +0200 Subject: [PATCH] [DEBUG] Add more logs from both WS transport and cube container in tests --- .github/workflows/push.yml | 2 +- packages/cubejs-client-ws-transport/src/index.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 057532433495d..a31dcd58f3b5d 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -612,7 +612,7 @@ jobs: cd packages/cubejs-testing/ export BIRDBOX_CUBEJS_VERSION=${{ matrix.tag }} export BIRDBOX_CUBEJS_REGISTRY_PATH=localhost:5000/ - export DEBUG=testcontainers + export DEBUG="testcontainers*" yarn run dataset:minimal yarn run birdbox:postgresql yarn run birdbox:postgresql-pre-aggregations diff --git a/packages/cubejs-client-ws-transport/src/index.ts b/packages/cubejs-client-ws-transport/src/index.ts index 947b47271f70e..898336fed4c5e 100644 --- a/packages/cubejs-client-ws-transport/src/index.ts +++ b/packages/cubejs-client-ws-transport/src/index.ts @@ -90,6 +90,8 @@ class WebSocketTransport implements ITransport { } public async close(): Promise { + // TODO sync with timeout in sendMessage: either flush or drop + console.log("close call, left queue", this.messageQueue); if (this.ws) { this.ws.close(); } @@ -191,7 +193,12 @@ class WebSocketTransport implements ITransport { this.messageQueue.push(message); } + console.log("sendMessage call, message", message); + console.log("sendMessage call, queue before timeout", this.messageQueue); + setTimeout(async () => { + console.log("sendMessage call, message", message); + console.log("sendMessage call, queue after timeout", this.messageQueue); await this.initSocket(); this.ws.sendQueue(); }, 100); @@ -242,6 +249,8 @@ class WebSocketTransport implements ITransport { return callback(result, () => this.subscribe(callback)); }, async unsubscribe() { + // TODO await unsub from server + console.log("unsubscribe call: ", message.messageId); transport.sendMessage({ unsubscribe: message.messageId }); delete transport.messageIdToSubscription[message.messageId]; }