I'm facing a situation I never encountered from years of rust development. When I run cargo test on my bevy project, my system is extremely performance impacted (project source code is available at GitHub - buxx/oc at iowait · GitHub). During compilation, my mouse, interaction with application freeze. Then, almost of the time graphical session crash / is restarted.
I tracked cpu, ram and disk usage. Only suspect thing is iowait (82%, but refresh is freeze too):
# sar 1 1
Linux 6.14.0-37-generic (crab) 29/04/2026 _x86_64_ (12 CPU)
18:17:13 CPU %user %nice %system %iowait %steal %idle
18:17:14 all 1,26 0,00 0,42 82,43 0,00 15,90
Moyenne : all 1,26 0,00 0,42 82,43 0,00 15,90
Are you sure the problem occurs during compilation and not running the test? What seems likely to me is a single test either doing runaway memory allocation, or causing a GPU reset.
You can try cargo test --no-run to see whether there is any problem with compilation only.
I would recommend trying compiling the program on a different computer. If it works well there, without any slowdown or crashes, it is plausible that the first computer has a bad CPU or bad RAM.
If it causes trouble on both computers, then either:
your program has something wrong with it that runs away at compile time somehow, or
rustc has a bug triggered by compiling your program.
In either case, the next step is test case minimization: make a copy/branch of your program, and remove everything that isn't required to cause the problem. Don’t preserve the meaning or functionality of your program; replace all your function bodies with panic!() unless they are part of causing the problem.
Once you have a minimized test case, you will have the material you need, either to understand why your program was so hard to compile, or to file a compiler bug report.