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

Fix the broken session expiration test #73

Merged
merged 1 commit into from
Mar 30, 2021

Conversation

foxbenjaminfox
Copy link
Contributor

While writing the test for #72, I noticed that the test for session expiration was broken: even if you removed the call to :timer.sleep(1000) the test would still pass.

By not reusing the secret between the two requests, the second request couldn't access the session from the first, meaning that even if the session hadn't expired it still wouldn't be accessible.

This PR fixes this test, so that it will fail properly if the session expiration doesn't work.

The session expiration test was broken: even if you removed the
call to :timer.sleep(1000) the test would still pass.

This is because each of the two requests used a different secret,
meaning that the second conn didn't have access to the session
from the first in any case.

By using sign_conn_with/3 instead of sign_conn/2, this test can use the
same secret for both conns, ensuring that this test actually tests what
it claims to be testing.
Copy link
Collaborator

@germsvel germsvel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this! 🎉

@germsvel germsvel merged commit b401e6f into beam-community:master Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants