Unbound growth of .cache/go-build when running gremlins #178
Replies: 6 comments
-
Hi @hknutzen, thanks for this report. I see the problem and the possible optimisation. Actually, Gremlins already recycles the working directories as you describe. It creates one working directory per worker and each worker reuses its directory rolling back the mutations. You can see that the Dealer caches the worker per worker. In the new timeout management I'm working on, I'm experimenting with cache disabling, but I'm still not convinced we have to disable it in integration mode, since some packages tests can be cached. Maybe, one solution could be to clean the test cache at the end of the run with |
Beta Was this translation helpful? Give feedback.
-
I tried a |
Beta Was this translation helpful? Give feedback.
-
When I run Now lets calculate, which size we expect from a run of OK, then 33G isn't that bad. |
Beta Was this translation helpful? Give feedback.
-
I think gremlins should use a separate temporary directory as Go build cache. https://pkg.go.dev/cmd/go#hdr-Build_and_test_caching
|
Beta Was this translation helpful? Give feedback.
-
Great idea! Definitely we should use a separate cache folder. I will change this issue into a discussion and I'll open an issue to address this change in gremlins. |
Beta Was this translation helpful? Give feedback.
-
I created issue #177 with high priority, I think we should address this as soon as possible. |
Beta Was this translation helpful? Give feedback.
-
I run gremlins on my project to check the tests of this project.
The project has more than 3000 test cases, all of them integration tests.
When running gremlins, it applies more than 5000 mutations.
I run gremlins with option --integration, so all tests are run for each mutation.
(The tests run with
t.Parallel()
and therefore complete in 1.1 seconds)In recent days I started gremlins multiple times, playing with different versions and different options.
Yesterday, during a run of gremlins, there was no space left on the home partition of my development server.
It took some time until I found the reason:
The Go build cache in $HOME/.cache/go-build has grown to a size of 135 GBytes.
That was surprising.
I cleaned the cache and startet another run of gremlins.
It completed successfully:
But the Go build cache has grown again:
Gremlins compiles the project from different temporary directories again and again.
For each compiler run, Go fills the build cache, expecting, that the same directory gets compiled again.
But this never happens.
I could always clean the build cache manually.
But there seems to be an opportunity for optimization:
undoing the last mutation and applying the next mutation.
I would expect a massive compile time improvement, since the Go build cache would be used now.
Beta Was this translation helpful? Give feedback.
All reactions