Skip to content

Add BaseEngineParSeqTest.java to make test suite run in parallel with no race conditions #354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Balaji4
Copy link

@Balaji4 Balaji4 commented Jul 1, 2025

** Testing done **
Tested the code with ./gradlew clean build.

BUILD SUCCESSFUL in 12m 6s
113 actionable tasks: 102 executed, 11 up-to-date

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 runs setup() and teardown() at method level) and BaseEngineParTest (which runs setup() and teardown() at class level) in parseq library. Both are prone to race condition issues for ParseqUnitTestHelper instance as it will be setup and teared down in different tests simultaneously when tests are executed in parallel.

Added BaseEngineParSeqTest.java, which runs setup() and tearDown() at test suite level and will also make sure that the shared ParseqUnitTestHelper 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 of build-info-extractor-gradle (the version doesn't exist in maven and gradle repository). Removing jcenter and updating build-info-extractor-gradle (bare minimum changes to fix build issues).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant