Add BaseEngineParSeqTest.java to make test suite run in parallel with no race conditions #354
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
** Testing done **
Tested the code with
./gradlew clean build
.Also tested with a giant private repo with thousands of unit tests (this base class also improved the test suite execution time by letting us run tests in parallel).
More details:
There are two changes in this PR:
Part 1:
We currently have
BaseEngineTest
(which runssetup()
andteardown()
at method level) andBaseEngineParTest
(which runssetup()
andteardown()
at class level) in parseq library. Both are prone to race condition issues forParseqUnitTestHelper
instance as it will be setup and teared down in different tests simultaneously when tests are executed in parallel.Added
BaseEngineParSeqTest.java
, which runssetup()
andtearDown()
at test suite level and will also make sure that the sharedParseqUnitTestHelper
instance will not have any race condition issues. This will fix all the race condition issues and tests can be executed in parallel at suite level thereby reducing the test suite execution time.Execution hierarchy for unit test setup and teardown methods with @before* and @after* annotations:
@BeforeSuite
or@AfterSuite
(executed only once per test suite)@BeforeClass
or@AfterClass
(executed for every test class)@BeforeMethod
or@AfterMethod
(executed for every test method)Part 2:
jcenter
is sunset as of Aug 15 2024 (source: https://jfrog.com/blog/jcenter-sunset/). Also, we are using an older version ofbuild-info-extractor-gradle
(the version doesn't exist in maven and gradle repository). Removing jcenter and updatingbuild-info-extractor-gradle
(bare minimum changes to fix build issues).