Skip to content

Commit

Permalink
Disable P2 mirrors by default
Browse files Browse the repository at this point in the history
Having p2 mirrors enabled has some drawbacks as it can lead to
instabilities see eclipse-equinox/p2#414 also
test can fail because a mirror can't be reached or is slow.

Because of this we should disable mirrors all together and only
selectively enable them for tests where this is required.
  • Loading branch information
laeubi committed Dec 16, 2023
1 parent bd2796d commit 1cb129d
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ protected Verifier getVerifier(String test, boolean setTargetPlatform, File user

Verifier verifier = new Verifier(testDir.getAbsolutePath());
verifier.setForkJvm(isForked());
if (isDisableMirrors()) {
verifier.setSystemProperty("tycho.disableP2Mirrors", "true");
}
String debug = System.getProperty("tycho.mvnDebug");
if (debug != null) {
System.out.println("Preparing to execute Maven in debug mode");
Expand Down Expand Up @@ -146,6 +149,14 @@ protected Verifier getVerifier(String test, boolean setTargetPlatform, File user

}

/**
* can be overridden by subclass to explicitly enable mirrors, by default they are disabled.
*
*/
protected boolean isDisableMirrors() {
return true;
}

protected boolean isForked() {
return true;
}
Expand Down

0 comments on commit 1cb129d

Please sign in to comment.