Skip to content

Use ExUnit's assert_receive_timeout as the default receive timeout - #2655

Merged
jeregrine merged 2 commits into
phoenixframework:mainfrom
felt:default-to-assert_receive_timeout
Jun 1, 2023
Merged

Use ExUnit's assert_receive_timeout as the default receive timeout#2655
jeregrine merged 2 commits into
phoenixframework:mainfrom
felt:default-to-assert_receive_timeout

Conversation

@s3cur3

@s3cur3 s3cur3 commented Jun 1, 2023

Copy link
Copy Markdown
Contributor

Per a brief discussion on Mastodon, this replaces the hardcoded default timeout of 100 milliseconds on message-receiving test functions (assert_patch, assert_redirect, assert_push_event, and assert_reply) with a lookup of ExUnit's assert_receive_timeout.

This makes the behavior of Phoenix.LiveViewTest more consistent with Phoenix.ChannelTest, where assert_receive, assert_push, assert_reply, and assert_broadcast all delegate to the ExUnit config for their default timeout.

…the behavior of Phoenix.ChannelTest

Per a [brief discussion on Mastodon](https://merveilles.town/@peregrine/110469721567235316), this replaces the hardcoded default timeout of 100 milliseconds on message-receiving test functions (`assert_patch`, `assert_redirect`, `assert_push_event`, and `assert_reply`) with a lookup of ExUnit's `assert_receive_timeout`.

This makes the behavior of `Phoenix.LiveViewTest` more consistent with `Phoenix.ChannelTest`, where `assert_receive`, `assert_push`, `assert_reply`, and `assert_broadcast` all delegate to the ExUnit config for their default timeout.
@s3cur3
s3cur3 marked this pull request as ready for review June 1, 2023 16:48
Comment thread lib/phoenix_live_view/test/live_view_test.ex Outdated
Comment thread lib/phoenix_live_view/test/live_view_test.ex Outdated
Comment thread lib/phoenix_live_view/test/live_view_test.ex Outdated
Comment thread lib/phoenix_live_view/test/live_view_test.ex
@jeregrine jeregrine self-assigned this Jun 1, 2023

@josevalim josevalim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Go ahead and merge it @jeregrine when you are happy too :)

@jeregrine

Copy link
Copy Markdown
Member

Just some docs fixes

@jeregrine

Copy link
Copy Markdown
Member

<3 thank you so much @s3cur3

@s3cur3

s3cur3 commented Jun 1, 2023

Copy link
Copy Markdown
Contributor Author

Thank you! 😄 💜

@jeregrine
jeregrine merged commit 1812c0e into phoenixframework:main Jun 1, 2023
@Nezteb

Nezteb commented Jun 1, 2023

Copy link
Copy Markdown
Contributor

💚💙💜💛❤️

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.

4 participants