I'm trying to parallelize our (Maven) build, and a...
# random
h
I'm trying to parallelize our (Maven) build, and as CPU load goes to 100% I have quite a few tests failing for various reasons (e.g. testcontainers startup times out, some tests use
Instant.now()
etc.). I'm currently fixing these one by one, but it's hard to always reproduce the errors (and therefore to be sure I really fixed it). Is there some library or framework to slow down test execution reproducibly, to find such errors?
c
It's not what you asked for and it may not even help, but I find that I can at least shake the 'flake tree' if I modify the number of forks used whilst executing tests. Often in my gradle configuration I'll have something that sets the
maxForks = Runtime.cpuCount() / 2 + 1
or something like that and if I copy the number that is generated by that scientific process on the CI machine, I often get lucky locally to get semi consistent reproduction of CI test failures. Of course, it's not a science, just a kind of shaman voodoo magic.