Skip to content

Commit

Permalink
Abort tests on timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mickaelistria committed Nov 17, 2023
1 parent 3ed5d71 commit 66f1d0c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Jenkinsfile
Expand Up @@ -4,7 +4,7 @@ pipeline {
}
options {
buildDiscarder(logRotator(numToKeepStr:'10'))
timeout(time: 1, unit: 'HOURS')
timeout(time: 30, unit: 'MINUTES')
}
environment {
PATH = "$HOME/.local/bin:$HOME/.cargo/bin/:$PATH"
Expand All @@ -31,9 +31,11 @@ pipeline {
wrap([$class: 'Xvnc', useXauthority: true]) {
sh './mvnw -Dmaven.repo.local=$WORKSPACE/.m2 clean verify -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Dtycho.showEclipseLog=true -Psign -Dsurefire.timeout=1800'
}
sh 'rust-analyzer --version'
}
post {
always {
sh 'rust-analyzer --version'
junit '*/target/surefire-reports/TEST-*.xml'
archiveArtifacts artifacts: '*/target/work/data/.metadata/.log'
}
Expand Down
Expand Up @@ -16,6 +16,7 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;

import java.time.Duration;
import java.util.concurrent.TimeUnit;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.IJobManager;
Expand All @@ -24,13 +25,15 @@
import org.eclipse.corrosion.extensions.ProgressParams;
import org.eclipse.swt.widgets.Display;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;

class TestLSPExtensions extends AbstractCorrosionTest {

private static final String PROGRESS_ID_1 = "progress_1";
private static final String PROGRESS_ID_2 = "progress_2";

@Test
@Timeout(value = 3, unit = TimeUnit.MINUTES)
void testBuildingMessages() {
String jobType = "Building";
RLSClientImplementation clientImplementation = new RLSClientImplementation();
Expand All @@ -50,6 +53,7 @@ void testBuildingMessages() {
}

@Test
@Timeout(value = 3, unit = TimeUnit.MINUTES)
void testIndexingMessages() {
String jobType = "Indexing";
RLSClientImplementation clientImplementation = new RLSClientImplementation();
Expand Down
Expand Up @@ -17,6 +17,7 @@
import java.io.IOException;
import java.time.Duration;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
Expand All @@ -29,10 +30,12 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;

class TestLSPIntegration extends AbstractCorrosionTest {

@Test
@Timeout(value = 3, unit = TimeUnit.MINUTES)
void testLSWorks() throws IOException, CoreException {
IProject project = getProject(BASIC_ERRORS_PROJECT_NAME);
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
Expand Down

0 comments on commit 66f1d0c

Please sign in to comment.