Skip to content

Commit

Permalink
[DEBUG] Add more logs from both WS transport and cube container in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcheshkov committed Jan 14, 2025
1 parent 2f11d20 commit 8ccadcb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions packages/cubejs-client-ws-transport/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ class WebSocketTransport implements ITransport<WebSocketTransportResult> {
}

public async close(): Promise<void> {
// TODO sync with timeout in sendMessage: either flush or drop
console.log("close call, left queue", this.messageQueue);

Check warning on line 94 in packages/cubejs-client-ws-transport/src/index.ts

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote
if (this.ws) {
this.ws.close();
}
Expand Down Expand Up @@ -191,7 +193,12 @@ class WebSocketTransport implements ITransport<WebSocketTransportResult> {
this.messageQueue.push(message);
}

console.log("sendMessage call, message", message);

Check warning on line 196 in packages/cubejs-client-ws-transport/src/index.ts

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote
console.log("sendMessage call, queue before timeout", this.messageQueue);

Check warning on line 197 in packages/cubejs-client-ws-transport/src/index.ts

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote

setTimeout(async () => {
console.log("sendMessage call, message", message);

Check warning on line 200 in packages/cubejs-client-ws-transport/src/index.ts

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote
console.log("sendMessage call, queue after timeout", this.messageQueue);

Check warning on line 201 in packages/cubejs-client-ws-transport/src/index.ts

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote
await this.initSocket();
this.ws.sendQueue();
}, 100);
Expand Down Expand Up @@ -242,6 +249,8 @@ class WebSocketTransport implements ITransport<WebSocketTransportResult> {
return callback(result, () => this.subscribe(callback));
},
async unsubscribe() {
// TODO await unsub from server
console.log("unsubscribe call: ", message.messageId);

Check warning on line 253 in packages/cubejs-client-ws-transport/src/index.ts

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote
transport.sendMessage({ unsubscribe: message.messageId });
delete transport.messageIdToSubscription[message.messageId];
}
Expand Down

0 comments on commit 8ccadcb

Please sign in to comment.