nextest-rs / nextest

A next-generation test runner for Rust.
https://nexte.st
Apache License 2.0
2.17k stars 96 forks source link

slow down, leaking ansi escapes in output #35

Closed fdncred closed 2 years ago

fdncred commented 2 years ago

Nice job with this! I was testing on nushell and it started out nice, then slowed way down and started leaking ansi escapes in the output.

My command line was cargo nextest run --all --all-features

image

Keep up the good work!

sunshowers commented 2 years ago

Thank you! To be clear, are you running within the nushell shell? I'm asking because I haven't seen this across months of testing, and nextest is careful to lock stderr for each line so at least in principle it shouldn't happen.

However, I do believe throwing in a BufWriter would be beneficial -- let me see if I can get a fix out soon.

fdncred commented 2 years ago

hi @sunshowers, i'm running in Windows 11 inside Windows Terminal using PowerShell Core.

Name                           Value
----                           -----
PSVersion                      7.2.1
PSEdition                      Core
GitCommitId                    7.2.1
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

I've also noticed something else that may be a tip for all your windows users. Maybe you already know this but I just missed it. Here's the tip. If you're on Windows and you're using Microsoft Defender, it's good to add an exclusion for your build folder. It took my run from 80 seconds to 10. I'm not sure if that's related to this ansi-leakage or not.

sunshowers commented 2 years ago

Thanks for the info about the enviroment! Ahh yeah, antivirus stuff on Windows is pretty unfortunate.

Going to get a fix for this out in a couple of hours.

fdncred commented 2 years ago

I'm really kind of thinking it's related to Microsoft Defender because when Defender is running on all these files, it pegs the cpu at 100% and that's why some of the tests are slow in the screenshot. So, one way to test this is to have a cpu stress program running while you run nextest to see if that's causing the leakage.

fdncred commented 2 years ago

ok. let me know when you have something to try. i have just reproduced it again, even with it running at full speed with the folder in my defender exception list.

image

sunshowers commented 2 years ago

Thanks @fdncred! Could you try:

cargo install --git https://github.com/sunshowers/nextest --branch bufwriter --bin cargo-nextest

and see if that fixes this issue?

fdncred commented 2 years ago

sure. i tried it 5 times without any visible leakage. I'll continue using it and report back if i see any issues. For now, I'd just accept the win and close this issue with a landed PR. thanks for the quick turn and the cool tool!

sunshowers commented 2 years ago

Just published 0.9.3 which should have a fix for this. Thanks again for reporting!