Skip to content
Permalink
Browse files
Merge pull request #428 from raul-arabaolaza/JENKINS-50790
[JENKINS-50790] Temporarily override pageLoadTimeout for available plugins
  • Loading branch information
olivergondza committed Apr 19, 2018
2 parents d8dc8ad + 7ba7a39 commit dad333092159cb368efc2f9869572f0a05d255ac
@@ -80,6 +80,8 @@

public static final String DOM_MAX_SCRIPT_RUN_TIME = "dom.max_script_run_time";
public static final String DOM_MAX_CHROME_SCRIPT_RUN_TIME = "dom.max_chrome_script_run_time";
public static final int PAGE_LOAD_TIMEOUT = 30;
public static final int IMPLICIT_WAIT_TIMEOUT = 1;

@Override
protected void configure() {
@@ -193,8 +195,8 @@ public WebDriver createWebDriver(TestCleaner cleaner, TestName testName, Elastic
d.register(new Scroller());

try {
d.manage().timeouts().pageLoadTimeout(time.seconds(30), TimeUnit.MILLISECONDS);
d.manage().timeouts().implicitlyWait(time.seconds(1), TimeUnit.MILLISECONDS);
d.manage().timeouts().pageLoadTimeout(time.seconds(PAGE_LOAD_TIMEOUT), TimeUnit.MILLISECONDS);
d.manage().timeouts().implicitlyWait(time.seconds(IMPLICIT_WAIT_TIMEOUT), TimeUnit.MILLISECONDS);
} catch (UnsupportedCommandException e) {
// sauce labs RemoteWebDriver doesn't support this
System.out.println(base + " doesn't support page load timeout");
@@ -14,6 +14,7 @@

import com.google.common.base.Predicate;
import org.apache.commons.lang3.StringUtils;
import org.jenkinsci.test.acceptance.FallbackConfig;
import org.jenkinsci.test.acceptance.junit.WithPlugins;
import org.jenkinsci.test.acceptance.update_center.PluginMetadata;
import org.jenkinsci.test.acceptance.update_center.PluginSpec;
@@ -227,7 +228,15 @@ public boolean installPlugins(final PluginSpec... specs) throws UnableToResolveD
}
}
} else {
visit("available");

// JENKINS-50790 It seems that this page takes too much time to load when running in the new ci.jenkins.io
try {
driver.manage().timeouts().pageLoadTimeout(time.seconds(60), TimeUnit.MILLISECONDS);
visit("available");
} finally {
driver.manage().timeouts().pageLoadTimeout(time.seconds(FallbackConfig.PAGE_LOAD_TIMEOUT), TimeUnit.MILLISECONDS);
}
// End JENKINS-50790

final ArrayList<PluginSpec> update = new ArrayList<>();
for (final PluginSpec n : specs) {
@@ -249,12 +249,11 @@ public void clean_before_checkout() {
public void create_tag_for_build() {
GitRepo repo = buildGitRepo();
repo.transferToDockerContainer(host, port);

job.useScm(GitScm.class)
.url(repoUrl)
.credentials(USERNAME)
.customNameAndMail("fake", "fake@mail.com")
.createTagForBuild();

job.addShellStep("git tag -n1");
job.save();
Build b = job.startBuild();

0 comments on commit dad3330

Please sign in to comment.