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

Understand and refactor "test__081__Channel__publish__Connection_state_conditions__the_message__should_NOT_be_queued_..._ATTACHED" #1798

Closed
maratal opened this issue Sep 10, 2023 · 1 comment · Fixed by #1926
Assignees
Labels
testing Includes all kinds of automated tests, the way that we run them and the infrastructure around them.

Comments

@maratal
Copy link
Collaborator

maratal commented Sep 10, 2023

The test "test__081__Channel__publish__Connection_state_conditions__the_message__should_NOT_be_queued_instead_it_should_be_published_if_the_channel_is__ATTACHED" fails on the CI under macOS 13 [Beta] for several reasons:

in case of ttl <= 5 (seconds) it fails auth process with the error "Error 40142 - Token expired. (See https://help.ably.io/error/40142 for help.)". Locally it doesn't fail. If to increase ttl, the realtime never sends DISCONNECTED message, and this test ends up with a series of AUTH, and fails with timeout not receiving DISCONNECTED message.

What I've noticed, is that all ttl values less than 30 seconds realtime considers as 0 and expires token immediately, whereas values greater than 30, it only takes the part above 30 (so it subtracts 30 form ttl value), and expires token in the remainder value of seconds (35 - 30 = 5 seconds of token ttl).

According to RTN22a "Ably reserves the right to forcibly disconnect a client that does not re-authenticate within an acceptable period of time, or at any time the token is deemed no longer valid. A client is forcibly disconnected following a DISCONNECTED message containing an error code in the range 40140 <= code < 40150. This will in effect force the client to re-authenticate and resume the connection immediately."

So, the realtime not sending a DISCONNECTED message is an expected behaviour and the fact that this test works under macOS 12 on CI and locally under macOS 13 is rather by accident or a realtime bug.

Besides all of this, the test itself doesn't do what it title says and makes assertions in contradiction to it, f.e. the title says "should NOT be queued", but tests expects client.internal.queuedMessages.count to be 1.

So I temporarily have made this test to be similar to "test__080...". The only difference is expecting ATTACHED in oppose to ATTACHING in the "test__080...".

┆Issue is synchronized with this Jira Task by Unito

@sync-by-unito
Copy link

sync-by-unito bot commented Sep 10, 2023

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3846

@lawrence-forooghian lawrence-forooghian added the testing Includes all kinds of automated tests, the way that we run them and the infrastructure around them. label Apr 22, 2024
maratal added a commit that referenced this issue May 26, 2024
…otivation of it isn't clear for me too, it tests queueing messages while connection state is DISCONNECTED and the channel is still ATTACHED, but according to RTL6c2 messages should be queued regardless channel state (except SUSPENDED or FAILED), which is already tested in "test__078__Channel..." and "test__077__Channel..."/"test__076__Channel..." for INITIALIZED and CONNECTING connection states respectively. The situation with `ttl` described in the issue #1798 isn't reproducable anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Includes all kinds of automated tests, the way that we run them and the infrastructure around them.
Development

Successfully merging a pull request may close this issue.

2 participants