-
Notifications
You must be signed in to change notification settings - Fork 15
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
MTE's own test suite is very slow #49
Comments
While testing MovingBlocks/Terasology#4611 , the test run failed with:
|
I wonder if we can formulate this issue less vague - "very slow" is subjective (which is not me saying, it's not very slow 😉 ) and makes it hard to assess when this issue would actually be resolved. |
Probably the real achievement here would be to understand what is taking so much time and why. But if we want a range to aim for, I'd say 5 seconds per test would make it merely "really slow" instead of the "extraordinarily slow" it is now. That'd be about two minutes for the suite of 22 tests. |
After saying that, it did run in under two minutes on my branch just now. (though not every test was under 5s) Does that branch speed it up so much? Or is it faster because I only have iota modules, and it would be slower in an omega workspace? 🤔 |
We've definitely seen issues in the past caused/aggravated by the presence of other modules, even if they aren't activated for whatever is going on. But on the other hand it is slow in Jenkins which has the minimum amount of modules. If the tests in the MTE itself are just more memory hungry, are we sure they'll take advantage of all available memory? I think the current build agents are configured to offer up to 6 GB, but I have no idea if Gradle is allowing that (especially if it launches in different contexts / peripheral ones like module test cases rather than a plain engine build) |
The devil is in the detail here: The tests are not running out of heap space, but out of native memory space. The eBay team wrote a SRE Case Study on this, and there a couple of other blog posts on troubleshooting it.
It does look like we accumulate more and more used memory in the native space each time we start up a new engine for an MTE test, seemingly without cleaning up that memory in between. I can run a couple of tests locally just fine, but once crossing a specific threshold the test executor will crash eventually. In a bit more detail: it all starts from
It does look like we have a native memory leak in there, which becomes apparent here because we start and stop the engine a bunch of times... Eventually, the test executor will crash with the above mentioned OOM.
|
It seems likely that some of the things causing problems for re-using the same process for multiple MTE tests might also have been causing problems for switching between games in the same Terasology run. There was some work on that in MovingBlocks/Terasology#4829; we should review that and see if MTE is doing the appropriate dispose steps. |
Follow-ups:
[closing because I can't transfer issues between @Terasology and @MovingBlocks] |
This issue is not "Tests which use
@ExtendWith(MTEExtension.class)
are slow,"it is "Running
:modules:ModuleTestingEnvironment:test
is slow."On my workstation it takes about eight minutes, which is about as much as everything else (including engine!) put together. And it's not because MTE has a zillion tests!
Maybe in the process of fixing this, we discover what's been making MTE-using tests so slow to boot up in general.
The text was updated successfully, but these errors were encountered: