-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
Fix flaky tests on the ci #303
Comments
The mock packets in the tests are all static, hand-crafted values. So I think it's definitely due to some funkiness in ratatui. If necessary I can go ask their maintainers for assistance directly. I'm also thinking, maybe testing the terminal output (and events) equality to a T is overly strict and frankly silly. Is there perhaps a better way to test the general functionality of the TUI without necessarily demanding strict equality? |
Take a look at the CI runs in #305. They are starting to pass consistently (well, somewhat consistently) without me specifically tackling them. I think the issue was that we were testing right at the edges of "layout switches", and the terminal emulator (or whatever silly component it is) had some kind of spontaneous and intermittent off-by-one error somewhere. Now that I've completely changed the "layout switch edges" (what I called "cutoff points" in code), these off-by-one errors are no longer getting triggered. Frankly speaking we can just leave it here and call it a day. But the perfectionist in me still wants to find a better way to test this. as mentioned in my previous post. |
Well, I found one of the problems Take a look at the uploaded snapshots in this CI run. |
Awesome work @cyqsimon hopefully we finally get a green ci |
! checked the last ci runs failure, its unclear to me why they fail there doesn't seem a failure in a test or even an error ? Do you have an idea about this ? |
I think I have a decent grasp on the root cause of the situation. See my own replies underneath #308. The best way forward is most certainly a big refactor, which is forthcoming™️. Give me a bit of time. |
Thanks for your work @cyqsimon ! |
Hey @cyqsimon I saw there are still some issues with whole CI ; there are flaky tests as well as some clippy issues for certain platform/toolchains. I'd like to try and help, but wanted to check in once before I start if you have something planned/being worked on or do you want to do this in some certain way. |
Yeah we've spent a whole lot of time figuring out why tests are so flaky. The reason comes down to a race condition at program termination. The way the main loop is written now, it's possible for an extra frame to be drawn before the process exits, which causes the test output to differ from the expected value stored in snapshots. The effect is mostly harmless, apart from the tests failing. However I have noticed that sometimes the extra frame can be drawn after the terminal has left the alternate screen state, creating some garbage on the terminal. In the worst case this can require a Regardless, yeah this is something I do plan to fix. I've already done some major restructuring of the main loop to use message passing, but there are still lots of As of the clippy issue, I did take a look today. It's just a newly promoted lint in nightly Rust causing problems so nothing serious. I partially addressed it in #432, but a few warnings actually originate from the expanded code of Unfortunately the crate seems abandoned, so we can't even submit a PR. Moving to something like Lines 36 to 38 in 4faccd1
Granted it's not a big deal, just have to do a manual
Thanks for offering; we can indeed use the help. I was originally planning to do the refactor alone, so I haven't bothered to push it. But since you want to help I'll prepare a WIP branch for it. Will ping you when ready. |
Just checking off the comments on that issue, https://github.com/magiclen/educe/ might be another alternative? I haven't looked at the code of bandwhich in detail, but from the readme of
😂 ✌️
Glad to help if I can! Also if it is going to be more work for you to make a WIP branch, and you feel that at this stage it is better if you develop this part alone, that is fine too. I just saw that the CI was failing, and this repo could is accepting contributions, so commented. |
Yeah it looks like it will work. PR welcomed!
Not at all. Any additional input, let it be ideas, code, review, second opinions or whatever is greatly appreciated, especially given my very meagre time constraints. It also helps that I'm no longer that kid who thinks it's my way or the highway 😅 (at least I'd like to think so). |
ref imsnif#303 (comment) Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
This is just an issue to remind us and to get other people to look into this.
Currently tests are flaky on the ci (they mostly fail):
If we could pinpoint the most flaky tests and disable those I think that would be a good starting point. We can always re-enable stuff gradually after.
The text was updated successfully, but these errors were encountered: