Limit which tests can run in parallel

Some tests modify global resources. Those tests cannot be run in parallel with others, as they cause problems or become flaky. Where possible, indicate to JUnit the resources in contention. Otherwise, mark the tests as needing to run in isolation.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887630 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Marius Volkhart 2021-03-14 10:42:15 +00:00
parent 5d77d4e798
commit 677ae9b8b9
4 changed files with 14 additions and 3 deletions

View File

@ -26,7 +26,10 @@ import org.apache.poi.hssf.record.RecordInputStream;
import org.apache.poi.util.NullPrintStream;
import org.apache.poi.util.RecordFormatException;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.parallel.ResourceLock;
import org.junit.jupiter.api.parallel.Resources;
@ResourceLock(Resources.SYSTEM_OUT)
class TestEFBiffViewer extends BaseTestIteratingXLS {
@BeforeAll
public static void setup() {

View File

@ -27,7 +27,10 @@ import org.apache.poi.hssf.record.RecordInputStream;
import org.apache.poi.util.NullPrintStream;
import org.apache.poi.util.RecordFormatException;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.parallel.ResourceLock;
import org.junit.jupiter.api.parallel.Resources;
@ResourceLock(Resources.SYSTEM_OUT)
class TestFormulaViewer extends BaseTestIteratingXLS {
@BeforeAll
public static void setup() {

View File

@ -30,10 +30,12 @@ import org.apache.poi.util.RecordFormatException;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.junit.jupiter.api.parallel.Isolated;
import org.junit.jupiter.api.parallel.ResourceLock;
import org.junit.jupiter.api.parallel.Resources;
@Execution(ExecutionMode.CONCURRENT)
@Isolated("Modifies the test data directory")
@ResourceLock(Resources.SYSTEM_OUT)
class TestReSave extends BaseTestIteratingXLS {
@BeforeAll
public static void setup() {

View File

@ -24,7 +24,10 @@ import org.apache.poi.hssf.OldExcelFormatException;
import org.apache.poi.util.NullPrintStream;
import org.apache.poi.util.RecordFormatException;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.parallel.ResourceLock;
import org.junit.jupiter.api.parallel.Resources;
@ResourceLock(Resources.SYSTEM_OUT)
class TestRecordLister extends BaseTestIteratingXLS {
@BeforeAll
public static void setup() {