-
Notifications
You must be signed in to change notification settings - Fork 104
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
Testing suite is too slow #285
Comments
Regarding GitHub CI, this never fails (or at least not to my knowledge). The red stars you see in the latest commits are due to my impatience of merging without waiting for the tests to finish (since I only modified documentation files). The behavior of GitHub CI seems to be that the CI stops (quite understandably)... To the tests, indeed anything that still does the job of checking an operator but shorter in terms of time is welcome. I went ahead and made some small changes to Feel free to take a look at test_SeismicInterpolation2d, here I worry it may be harder because L1 solver need a large number (100s) of iterations to converge so we may need to either reduce thresholds of acceptance or again try to make the example smaller (if possible) |
In order to speed up our CI pipeline, PyLops#285 suggested to reduce the size of a number of tests, test_wavedecomposition being one of them. The tests are now running with a smaller input data.
Awesome, thank you! Runtime has now dropped to 180s. If you don't mind, I think we can keep the issue open so we don't forget to improve the runtime of other tests. |
Yep, agree. As 1 and 4 are now very fast, I think if we can improve on 2 and 3 the overall timing of the test suite should become more reasonable. I am a bit unsure how much effort we should put on any test taking <5s as it may be more than the actual gain. What do you think? |
I think in the list of priorities it is not very far up, but it would definitely be nice at least remove the tests that take a long time (>5s). I can mark this as a first issue and we could maybe help people who want to get their toes wet with PyLops to tackle these issues? It is an excellent way of learning about the library. |
Hello @dikwickley, |
@mrava87 it was used with jenkins. we just need to add |
Mmmh, we need to be able to run our CI with either GitHub Actions or Azure Pipelines (ideally both as we do now). Please have a look if this is allowed by those CI platforms before implementing it. If yes, we will be happy for you to go ahead and make a PR with the suggested changed :) |
Alright, good to see. I was a bit unsure this would bring much improvement as we heavily use numpy (most methods are multi-threaded) and so we would end up trading the speed-up of multi-threaded functions with that of having multiple processes working in parallel. I am not in favour of removing any test. If you want you can run the test suite locally like @cako did in the past (see above), identity the tests that take longer and try to reduce the size of the problem for those tests… we did this already for the very heavy ones, but I remember writing this issue as we thought there are at least a couple more that could be further sped up. |
We can use the |
Sure. Even if you just run tests in a IDE like Pycharm/VSCode you can get directly stats on duration. I suggest you look at the top 5 and we can discuss which one makes sense to tackle first. There may be problems that we can’t make smaller than what they are as the inversion test would simply be not representative anymore |
Sounds good. Well based on knowledge of the problem. You can start taking the top one and reduce its size, but I would not just run it as test blindly, I would also make some plots to see what the input is, what the expected output is and what the one obtained is… and use tutorials using the same operators to understand what the problem entails if you are not familiar :) |
On a Intel Core i7-8565U CPU @ 1.80GHz × 8, the full test suite takes on average, 250s. I have noticed that tests are routinely failing in the GitHub CI, and I believe it may be because of this.
To profile the matter, I generated a list of all tests which take more than 2 seconds to run (see below). It seems WavefieldDecomposition and SeismicInterpolation are the biggest culprits, so one suggestions would be to make the dimensions in those examples smaller.
The text was updated successfully, but these errors were encountered: