acceptance-test-harness
acceptance-test-harness copied to clipboard
Optimise `RepositorySystem` usage
One more thing post merge @basil and @timja I just realized:
While debugging, I kinda saw that AetherModule
is constructed twice (I may be wrong here) per test.
But in any case, I am pretty much sure that RepositorySystem
is not being extended dynamically (as in added new transport, removed transport), so to me it seems likely possible you need one cached instance of RepositorySystem
. There is no reason to build and then tear down it, as it is same. RepositorySystem
is stateless, while RepositorySystemSession
is not (!).
So I think your lengthy tests could be mildly improved, if you split the two: keep RepositorySystem
across whole run (as it has huge object graph, but is stateless and you do not change it), but create RepositorySystemSession
per-case basis.
Originally posted by @cstamas in https://github.com/jenkinsci/acceptance-test-harness/issues/1733#issuecomment-2372371153