use of org.jenkinsci.test.acceptance.plugins.build_timeout.BuildTimeout in project acceptance-test-harness by jenkinsci.
the class TSRBuildTimeoutPluginTest method fail_build_with_absolute_time.
/**
* # TODO: The build-timeout plugin doesn't allow timeouts less than 3 minutes
* # in duration.
* #JENKINS-19592
* @wip
* Scenario: Fail a blocked build with absolute timeouts
* Given I have installed the "build-timeout" plugin
* And a job
* When I configure the job
* And I add a shell build step "sleep 200"
* And I set the build timeout to 3 minutes
* And I set abort build description
* And I save the job
* And I build the job
* Then the build should fail
*/
@Test
public void fail_build_with_absolute_time() {
FreeStyleJob j = jenkins.jobs.create();
j.configure();
{
j.addShellStep("sleep 300");
BuildTimeout t = new BuildTimeout(j);
t.abortAfter(3);
t.writeDescription();
}
j.save();
j.startBuild().waitUntilFinished(300).shouldAbort();
}
use of org.jenkinsci.test.acceptance.plugins.build_timeout.BuildTimeout in project acceptance-test-harness by jenkinsci.
the class BuildTimeoutPluginTest method fail_build_if_likely_stuck.
@Test
public void fail_build_if_likely_stuck() {
FreeStyleJob j = jenkins.jobs.create();
j.configure();
j.addShellStep("sleep 1");
j.save();
for (int i = 0; i < 3; i++) j.startBuild().shouldSucceed();
j.configure();
{
j.addShellStep("sleep 300");
BuildTimeout t = new BuildTimeout(j);
t.abortWhenStuck();
t.writeDescription();
}
j.save();
j.startBuild().waitUntilFinished(300).shouldAbort();
}
use of org.jenkinsci.test.acceptance.plugins.build_timeout.BuildTimeout in project acceptance-test-harness by jenkinsci.
the class BuildTimeoutPluginTest method fail_build_with_absolute_time.
@Test
public void fail_build_with_absolute_time() {
FreeStyleJob j = jenkins.jobs.create();
j.configure();
{
j.addShellStep("sleep 300");
BuildTimeout t = new BuildTimeout(j);
t.abortAfter(3);
t.writeDescription();
}
j.save();
j.startBuild().waitUntilFinished(300).shouldAbort();
}
use of org.jenkinsci.test.acceptance.plugins.build_timeout.BuildTimeout in project acceptance-test-harness by jenkinsci.
the class TSRBuildTimeoutPluginTest method fail_build_if_likely_stuck.
/**
* #JENKINS-19592
* @wip
* Scenario: Fail a blocked build if likely stuck
* Given I have installed the "build-timeout" plugin
* And a job
* When I configure the job
* And I enable concurrent builds
* And I add a shell build step "sleep 1"
* And I save the job
* And I build 3 jobs
* And I wait for build to complete
* And I configure the job
* And I set the build timeout to likely stuck
* And I change a shell build step to "sleep 20"
* And I save the job
* And I build the job
* Then the build should fail
*/
@Test
public void fail_build_if_likely_stuck() {
FreeStyleJob j = jenkins.jobs.create();
j.configure();
j.addShellStep("sleep 1");
j.save();
for (int i = 0; i < 3; i++) j.startBuild().shouldSucceed();
j.configure();
{
j.addShellStep("sleep 300");
BuildTimeout t = new BuildTimeout(j);
t.abortWhenStuck();
t.writeDescription();
}
j.save();
j.startBuild().waitUntilFinished(300).shouldAbort();
}
Aggregations