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

[ECO-4128] Fix race condition in authbase0 test case #1579

Merged
merged 1 commit into from
Apr 16, 2024
Merged

Conversation

VeskeR
Copy link
Contributor

@VeskeR VeskeR commented Jan 16, 2024

Resolves #1578

@github-actions github-actions bot temporarily deployed to staging/pull/1579/features January 16, 2024 13:02 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1579/bundle-report January 16, 2024 13:03 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1579/typedoc January 16, 2024 13:03 Inactive
@VeskeR VeskeR changed the title Fixes race condition in authbase0 test case Fix race condition in authbase0 test case Jan 19, 2024
@VeskeR VeskeR changed the title Fix race condition in authbase0 test case [ECO-4128] Fix race condition in authbase0 test case Mar 8, 2024
There was an intentional change in realtime code regarding populating
`TokenDetails.issued` field based on `timestamp` field provided by the
request [1]. Starting from this change, provided `timestamp` field
can now used to set the `TokenDetails.issued` field. It is done to
"Make it easier to construct reliable tests for eg token expiry and
revocation, by controlling the timestamp we pass in."

This does, however, mean that in order for time-sensitive tests to work
properly and avoid race conditions, we need to always either set
`queryTime: true` or set `queryTime: false`. We need to ensure that we
use the same value everywhere, so that the realtime code returns
`TokenDetails.issued` based on consistent data when we need to check it.

This commit does that for the tests where we use `TokenDetails.issued`
in assertions.

Resolves #1578

[1] ably/realtime@359930d
@VeskeR VeskeR merged commit 5911e9a into main Apr 16, 2024
12 checks passed
@VeskeR VeskeR deleted the 1578-fix-authbase0 branch April 16, 2024 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

realtime/auth.authbase0 test case can fail due to race condition
2 participants