-
Notifications
You must be signed in to change notification settings - Fork 175
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
Speed up tests #682
Speed up tests #682
Conversation
Still prints the failure for each test, which is a pointless noise, but some tools might depend on it. Signed-off-by: Radim Krčmář <[email protected]>
We know the tests are going to fail and tooling should be fixed if it depends on the total amount of tests. Signed-off-by: Radim Krčmář <[email protected]>
There is a bug in the build process if we need to make clean between builds. We originally needed make clean to avoid running test with the old binary, but that has been fixed. Run the tests without wasting time by rebuilding the binaries. The tests now run much faster, so maybe we can finally require ```git rebase -x './tests/run_tests.sh' origin/master``` before submitting patches and do it for pull requests. (Testing for regressions is slow even after this if the patch series is also supposed to be properly split.) Signed-off-by: Radim Krčmář <[email protected]>
Well, there are more options to the build than just ARCH (which you're right is captured in the path these days). If you drop the clean then you're relying on existing builds to not be tainted with such options, and could end up with a mix of tainted (ones you built) and untainted (ones you didn't already build) builds being tested. So I'm personally against this. What I'd be ok with is providing an opt-in option to the script that lets you skip the cleans. Also, re:
The first two commits seem ok at a glance. |
The build system should properly rebuild with respect to all inputs, be it file, command line argument, or environment variable, but I haven't tested all possible cross compiling and whatnot, so I'm fine with having this applied locally. |
Like most pure Makefile build systems, it doesn't, because there's no split between configure and build. The in-progress transition to CMake will resolve this (by instead using the configuration options for all builds when testing, and thus ensuring consistency, albeit in a different way). |
Ok, I will revisit this after the CMake switch. Below are the times for current version without patches:
r= real (wall) time, u/k= cpu time in userspace/kernel space, mm= maximum memory occupation, pf= page faults from disk+from memory, io= input/output operations, cs= voluntary context switches+preepmtion. With this Pull request:
The difference between 10 and 5 minutes for the first build will be noticeable even for CI. Subsequent builds save another two minutes. I also skip the rvfi builds while developing, because it never caught anything, to save another minute and half
and run the tests in parallel, to allow testing between every change
because if the simulators are already compiled, the tests take just 6 seconds:
|
Yeah I don't think there's any need for anything beyond switching to CMake. That can run all the tests in something like 5 seconds - most of the time is compilation, and that is also done in parallel. Minor caveat on the 5 seconds: that's how long it takes in our fork, for some reason in my CMake PR it is more like 40 seconds, which is weird. It is using a completely different emulator but I can't think of any reason why there should be such a speed difference. I need to investigate that. |
It's ~30s for me if I don't run the tests in parallel. I have local patch to parallelize RV32 tests, wait, and parallelize RV64 tests. It could be ~3s if tests from both architectures ran in parallel as well, but that would be way more work. |
The time saving isn’t from making the first build faster. If you’ve just done make clean then of course it’s going to be exactly the same as if the script did (minus the negligible time make clean itself takes). The saving comes from not building the softfloat libs each time. I wouldn’t be against having an opt-in option to skip that during clean that all but the first make clean in the test script enables, as that would indeed speed up CI. |
CMake does this, and also doesn't rebuild softfloat every time. |
Obsoleted by CMake rework. |
Ah this was because I was accidentally not running the |
Tests shouldn't rebuild riscv_model_RVxx when we have already compiled it.
Detailed motivation is in the third patch. First two make it possible.