This page covers common performance issues caused by anti-malware protections on Windows and macOS. These performance issues are not unique to nextest, but its execution model may exacerbate them.
Your antivirus software—typically Windows Security, also known as Microsoft Defender—might interfere with process execution, making your test runs significantly slower. For optimal performance, exclude the following directories from checks:
- The directory with all your code in it
.cargo\bindirectory, typically within your home directory (see this Rust issue).
Similar to Windows Security, macOS has a system called Gatekeeper which performs checks on binaries. Gatekeeper can cause nextest runs to be significantly slower. A typical sign of this happening is even the simplest of tests in
cargo nextest run taking more than 0.2 seconds.
Adding your terminal to Developer Tools will cause any processes run by it to be excluded from Gatekeeper. For optimal performance, add your terminal to Developer Tools. You may also need to run
cargo clean afterwards.
sudo spctl developer-mode enable-terminalin your terminal.
- Go to System Preferences, and then to Security & Privacy.
- Under the Privacy tab, an item called
Developer Toolsshould be present. Navigate to it.
- Ensure that your terminal is listed and enabled. If you're using a third-party terminal like iTerm, be sure to add it to the list (You may have to click the lock in the bottom-left corner and authenticate).
- Restart your terminal.
There are still some reports of performance issues on macOS after Developer Tools have been enabled. If you're seeing this, please add a note to this issue!