Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEBUG] Failing WebSocket transport tests #9099

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
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
14 changes: 14 additions & 0 deletions packages/cubejs-client-ws-transport/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,14 @@
}

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) {
// Send everything queued
// This should be coherent with calling unsub and then close: unsub is async, but not actually synchonnizing, not on sendinig nor receiving ack
// TODO or drop it? Or unsubscribe cleanly?
this.ws.sendQueue();

this.ws.close();
}
}
Expand Down Expand Up @@ -191,7 +198,12 @@
this.messageQueue.push(message);
}

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

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
console.log("sendMessage call, queue before timeout", this.messageQueue);

Check warning on line 202 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 205 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 206 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 +254,8 @@
return callback(result, () => this.subscribe(callback));
},
async unsubscribe() {
// TODO await unsub from server
console.log("unsubscribe call: ", message.messageId);

Check warning on line 258 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
Loading