Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352064 - tycho integration tests are too slow
Summary: tycho integration tests are too slow
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Jan Sievers CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 365012
Blocks:
  Show dependency tree
 
Reported: 2011-07-14 05:44 EDT by Jan Sievers CLA
Modified: 2021-04-28 16:55 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Sievers CLA 2011-07-14 05:44:37 EDT
executing tycho integration tests takes 20 or more minutes which makes the development turnaround cycle for tycho too slow.

Some options we could consider to speed up execution time:

- don't fork VM for maven calls. This should be possible using the most recent version of maven verifier (have to make sure we clean all caches/static state though)

- make sure all tests which reach out to the network use a local file:// p2 repo instead
Comment 1 Jan Sievers CLA 2011-07-14 05:50:21 EDT
example for in-process maven calls ( see profile "embedded"):

http://svn.apache.org/repos/asf/maven/core-integration-testing/trunk/core-it-suite/pom.xml
Comment 2 Jan Sievers CLA 2011-09-12 08:48:31 EDT
I tried running ITs (test classes, not methods) in parallel with surefire 2.9:

<parallel>classes</parallel>
<threadCount>2</threadCount>					

on my machine, this speeds up total IT test execution time by a factor of 4 to 5.
(down from ~20 min to ~4-5 min)

What we would need to do for parallel test class execution to work reliably:

- tests need to be truly independent of each other
=> separate a few test projects which are shared between several test classes 
=> check for statics/singletons used from concurrent tests

- local repo needs to be pre-filled with p2 caches (and any needed maven deps)
  (For p2 I have the idea of using the p2 mirror mojo before running ITs  to 
   fill a local p2 repo with minimal content, say org.eclipse.rcp feature.
   All ITs would then use the local p2 repo and no longer go on the network)

- concurrent access to tycho index files in local repo should be protected (bug 347963 )

Especially the last point is some effort but will pay off in the long run IMHO.
Comment 3 Igor Fedorenko CLA 2011-09-12 09:18:43 EDT
(In reply to comment #2)
> => check for statics/singletons used from concurrent tests
> 
> - local repo needs to be pre-filled with p2 caches (and any needed maven deps)
>   (For p2 I have the idea of using the p2 mirror mojo before running ITs  to 
>    fill a local p2 repo with minimal content, say org.eclipse.rcp feature.
>    All ITs would then use the local p2 repo and no longer go on the network)
> 
> - concurrent access to tycho index files in local repo should be protected (bug
> 347963 )
> 
> Especially the last point is some effort but will pay off in the long run IMHO.

What is the point in "pre-filling" p2 local cache? If the cache is not thread/process -safe, I think it makes far more sense to fix the cache than to find ways to pre-populate it. After all, running multiple builds concurrently _is_ expected to work.
Comment 4 Jan Sievers CLA 2011-09-12 09:52:19 EDT
(In reply to comment #3)
> What is the point in "pre-filling" p2 local cache? If the cache is not
> thread/process -safe, I think it makes far more sense to fix the cache than to
> find ways to pre-populate it. After all, running multiple builds concurrently
> _is_ expected to work.

sure. I mixed up 2 things here: For my local experiment I pre-filled the local repo so I would run into concurrency problems with less probability. The point here was just to find out the potential speed-up.

You are right that fixing the concurrency issue in bug 347963 would make this obsolete. For maven core, I understood that the multi-process safe local repo will only come with Tesla so up to then we need to make sure maven (plugin) dependencies of test projects are pre-filled before ITs run.
Comment 5 Jan Sievers CLA 2011-11-28 05:50:16 EST
http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=cc0a1231c5ea46dec13541a43a31a0f72363381d adds experimental support for running ITs in parallel (factor 4-5 speedup on my machine)
Comment 6 Igor Fedorenko CLA 2011-11-28 14:47:03 EST
Do I need to do anything special to run ITs beyond adding -Pparallel? I am getting a few IT failures on my macbookpro




Tests in error: 
  testP2DataGeneratedForPomDependency(org.eclipse.tycho.test.pomDependencyConsider.p2Data.generate.PomDependencyOnNonTychoArtifactTest): Exit code was non-zero: 1; command line and log = 
  testSigning(org.eclipse.tycho.test.jarsigning.JarSigningTest): Exit code was non-zero: 1; command line and log = 
  eeFromBREE(org.eclipse.tycho.test.bug364095_dependencyResolverBREE.DependencyResolverEETest): Exit code was non-zero: 1; command line and log = 
  test(org.eclipse.tycho.test.bug363331_extraTargetPlatformRequirements.ExtraTargetPlatformRequirementsTest): Exit code was non-zero: 1; command line and log = 
  testFeaturePatch(org.eclipse.tycho.test.featurePatch.build.FeaturePatchTest): Exit code was non-zero: 1; command line and log =
Comment 7 Jan Sievers CLA 2011-11-29 03:25:45 EST
(In reply to comment #6)
> Do I need to do anything special to run ITs beyond adding -Pparallel? I am
> getting a few IT failures on my macbookpro
> 
> 
> 
> 
> Tests in error: 
>  
> testP2DataGeneratedForPomDependency(org.eclipse.tycho.test.pomDependencyConsider.p2Data.generate.PomDependencyOnNonTychoArtifactTest):
> Exit code was non-zero: 1; command line and log = 
>   testSigning(org.eclipse.tycho.test.jarsigning.JarSigningTest): Exit code was
> non-zero: 1; command line and log = 
>  
> eeFromBREE(org.eclipse.tycho.test.bug364095_dependencyResolverBREE.DependencyResolverEETest):
> Exit code was non-zero: 1; command line and log = 
>  
> test(org.eclipse.tycho.test.bug363331_extraTargetPlatformRequirements.ExtraTargetPlatformRequirementsTest):
> Exit code was non-zero: 1; command line and log = 
>   testFeaturePatch(org.eclipse.tycho.test.featurePatch.build.FeaturePatchTest):
> Exit code was non-zero: 1; command line and log =

It's experimental because I suspect issues e.g. with tycho-p2-runtime when used by several concurrent processes (configuration/ folder cannot be shared by several processes I think)

Are your errors reproducible every time? If so please attach detailed surefire reports.

Errors I am seeing are rare and not reproducible.
Comment 8 Jan Sievers CLA 2011-12-05 05:46:55 EST
Even though I can imagine more changes to the integration tests to speed up execution time, parallel test execution with bug 365012 fixed solves this problem for me.
Comment 9 Igor Fedorenko CLA 2011-12-09 16:07:10 EST
FYI, I am having problems running -Pparallel with p2 juno M4 build. At least on macosx. Did not have a chance to try other platforms yet.
Comment 10 Igor Fedorenko CLA 2011-12-11 16:40:45 EST
Please disregard my last comment, I was not able to reproduce failures with -Pparallel once I fully updated to juno m4+ embedded runtime.