-
Notifications
You must be signed in to change notification settings - Fork 679
test(socket-mode): assert a certain amount of close events happen after disconnecting #2187
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #2187 +/- ##
=======================================
Coverage 91.94% 91.94%
=======================================
Files 38 38
Lines 10328 10328
Branches 652 652
=======================================
Hits 9496 9496
Misses 820 820
Partials 12 12
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
TBH this isn't what I expected, I assumed fewer than |
|
🙏 I'll rerun these tests to avoid failing checks, but I'm hopeful that this is helpful in the quest for fewer errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find!! 💯 this should really help us in our quest to save the flaky tests
There is a lot going on in this file, and possibly a lot to improve, my biggest concern is around beforeEach and afterEach. beforeEach takes care of setting up a new socket mode client, I would expect afterEach to take care of cleaning it up 🤔 but for some reason this is left up to the tests, this could very well be the source of some flakiness
Maybe we should consider instantiating a new server and wss for each tests
|
@WilliamBergamin Thanks so much for reviewing along this quest! 🙏
I'm quite interested in exploring this more. The setups you point out were becoming confusing to me when attempting to mock strange error states. This seems like another excellent follow up to explore if these tests continue to flake! But for now I'll merge this PR so we can start catching these flakes ❄️ 🔍 |
Summary
This PR asserts the "should maintain one serial reconnection attempt if WSS server sends unexpected HTTP response during handshake, like a 409" test has an expected number of retries after performing test cleanups.
This fixes an issue where a failing assert causes the test runner to not complete! This is for better insights into #2138 and #2159 patterns following #2178.
Preview
This video shows this failing test before and after the changes 👾
errors.mov
Notes
Handfuls of reruns makes me believe more and more that this test is failing due to how precise CI handles milliseconds and opened ports. This PR doesn't update related logic, but I'm hoping failing test results give us insight into this!
Requirements