Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #428 from raul-arabaolaza/JENKINS-50790
Browse files Browse the repository at this point in the history
[JENKINS-50790] Temporarily override pageLoadTimeout for available plugins
  • Loading branch information
olivergondza committed Apr 19, 2018
2 parents d8dc8ad + 7ba7a39 commit dad3330
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Expand Up @@ -80,6 +80,8 @@ public class FallbackConfig extends AbstractModule {

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() {
Expand Down Expand Up @@ -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");
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/plugins/GitPluginTest.java
Expand Up @@ -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();
Expand Down

0 comments on commit dad3330

Please sign in to comment.