Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The
assert_reply
channel test macro times out on the first test that invokesAbsinthe.run
and returns a result.Details
This PR contains models for
Chat.Message
andChat.User
, a new schema fieldmessage
, and a "graphql" channel that takes a standard GraphQL query, runs it through Absinthe, and returns the result.There is a test that verifies that this works. The test creates a Message, sends a message query to the graphql channel, and listens for a reply using the
assert_reply
macro.assert_reply
, by default, times out after 100ms.There are actually two tests that are nearly identical. The only difference is the test on line 44 uses
assert_reply
's default timeout. The test on line 28 increases the timeout to 300ms.I am using Elixir 1.4.0 and Erlang 19.2
To reproduce
Clone this repo:
Run the default timeout test:
The test fails:
That "The process mailbox is empty." line is a result of the assertion timing out before a message was received.
Now, run the test where the timeout is increased to 300ms
The test passes:
Now—and this is interesting—run both tests:
Both tests pass:
I have observed that only the first test that runs will fail with this timeout error, if it is left at the default 100ms. From that point on everything passes.