Repository navigation
test(relay): wait for the resume reply after reconnect - #262
Open
AndrewKirkovski wants to merge 1 commit into
Open
AndrewKirkovski wants to merge 1 commit into
AndrewKirkovski wants to merge 1 commit into
Conversation
The fixture plugin answers each shutdown through the hub, and the hub forwards plugin answers to the clients connected at that moment. When the second shutdown answer reaches the hub after the test's JOIN, the test receives it where it expects the resume echo, and every later read is one reply early. Skip late shutdown answers and assert the resume echo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes a race in the relay runtime test "cancels retirement on reconnect and continues using the same session plugin". It failed once in CI on #260 with
expected "after reconnect", got nil, although #260 does not touch relay.Cause. The fixture plugin answers every message through the hub, including each
shutdown. The hub forwards plugin answers to the clients connected at that moment (broadcast_to_clients). The test sends JOIN as soon as it sees the second shutdown in the lifecycle channel. When the plugin's answer to that shutdown reaches the hub after the JOIN, the hub forwards it to the test. The test then reads it where it expects the resume echo, and every later read is one reply early. The read that expects the echo gets the release answer, which has nodata.Fix. Test-only. After the reconnect, skip late
shutdownanswers and assert that the next answer is the resume echo. No runtime code changes.Evidence (local,
src/relay/testwith the module'smake testoverrides):shutdownanswer (not committed) makes the current test fail every time with the same CI message, at the same line, while the other 25 tests pass.scripts/run-wippy.shwas not used locally becausejqis not installed on that machine. The test folder's own config already replaceswippy/testwithsrc/test, as the script does.