Not all unit-tests run successfully in parallel

Description

When running tests via the surefire plugin, it has the capability to run tests in parallel.

Step 1: Update the top-level pom.xml to replace the deprecated forkMode configuration option with forkCount and reuseForks.

<forkMode>pertest</forkMode>

becomes:

<forkCount>1</forkCount>
<reuseForks>false</reuseForks>

Step 2: Adjust forkCount to be something greater than 1 (ie: 4, 1.5C, etc.)

Not all tests will run successfully in parallel as some have hard-coded socket properties. For example, the Mock SNMP Agent (tests/mock-snmp-agent) binds to port 1691 and so only one test for that project can be ran at a time.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Seth Leger June 24, 2016 at 10:50 AM

One thing to note here: after DJ's refactoring at Dev-Jam 2015, tests that open ports and create temp database have been renamed to failsafe integration tests instead of surefire unit tests. We should try to ensure that the surefire unit tests can work in parallel mode first. After that works, we can try and get the failsafe integration tests to work.

Seth Leger November 21, 2013 at 9:47 PM

Raising the priority of this one because I'd really like to see the unit tests get parallelized.

Ron Roskens May 29, 2013 at 11:32 PM

Tests that create temporary databases also fail when running in parallel because the admin database connection to template1 is left open.

org.postgresql.util.PSQLException: ERROR: source database "template1" is being accessed by other users

also shows the exception traces, and commented that this particular error was a timing issue.

Details

Assignee

Reporter

Labels

Affects versions

Priority

PagerDuty

Created May 29, 2013 at 2:31 PM
Updated September 21, 2021 at 9:18 PM