Skip to content

Fix flaky liveshare session test#5111

Merged
marwan-at-work merged 3 commits intotrunkfrom
marwan/seshtest
Jan 27, 2022
Merged

Fix flaky liveshare session test#5111
marwan-at-work merged 3 commits intotrunkfrom
marwan/seshtest

Conversation

@marwan-at-work
Copy link
Contributor

The session.keepAlive method by design drops requests if there's already one in flight. However, our tests send 2 requests and assert that two requests were received and none were dropped. The way it was achieving that is by hoping to sleep long enough between the two requests.

However, sleeping during tests for network requests to finish (even if by a local network) does not guarantee that said network requests will finish before the sleep is done and therefore we get rare but existing flakes where the session test below fails.

This PR switches sleeping two having waitgroups to ensure that the serve request is finished (note that only guarantees the server request function is finished and not that the client side has moved on).

internal issue: 6101

@marwan-at-work marwan-at-work requested a review from a team as a code owner January 27, 2022 15:56
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Jan 27, 2022
@cliAutomation
Copy link
Collaborator

Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message.

Copy link
Contributor

@adonovan adonovan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@josebalius josebalius left a comment

Choose a reason for hiding this comment

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

Thanks again @marwan-at-work! 🙏

Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

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

Excellent sleuthing 🎉 Thank you!

@marwan-at-work marwan-at-work merged commit 22c5269 into trunk Jan 27, 2022
@marwan-at-work marwan-at-work deleted the marwan/seshtest branch January 27, 2022 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants