Closed finagolfin closed 2 years ago
This test deliberately tests an extremely large write to hit a specific edge case that is only triggered when processing writes that are larger than 2 GB in size. The effect of the test is to allocate and dirty 4GB of memory. On machines with limited RAM this is necessarily going to cause issues.
The unfortunate reality is that there's no feasible way to make this test take less time or to test the functionality without exercising the code path. There is no hook at which we can intercept the code, and adding one for explicitly this purpose doesn't achieve a useful testing function. All we can do is skip the test on machines where the test is likely to be excessively costly. The 10s runtime of the test in CI is something I'm willing to tolerate, but for your small VPS we could plausibly attempt to skip the test instead.
Confirmed that the problem is gone on linux x86_64 and Android AArch64, thanks.
Ever since that test was added in #384/#385, I'm seeing crashes or hangs (on my Android CI) when running these tests, which looks like this on a small linux x86_64 VPS with 1 GB RAM and 2.4 GB swap:
Even on this repo's CI with a presumably beefy server, I see it takes 13.65 seconds just to run this single test. Disabling this test gets the tests running and passing again. On Android 12 in the Termux app, running this test crashes the app.
I think something needs to be done.