talawa-api icon indicating copy to clipboard operation
talawa-api copied to clipboard

Group Tests Based on Thread Affinity - Follow-up to Issue #2236

Open syedali237 opened this issue 5 months ago • 16 comments

Is your feature request related to a problem? Please describe. Summary: We have recently modified our test configuration to run tests using threads and disabled file parallelism to reduce the overall test runtime. However, parallelism may lead to race conditions, making certain tests flaky or unreliable.

To ensure the stability of our test suite, we need to:

Review and identify tests that may be prone to race conditions. Adjust the configuration to run such tests sequentially where necessary. Document any identified issues and the steps taken to mitigate them. This issue will track the investigation and any necessary changes to ensure our tests run reliably without unintended interference from parallel execution.

Describe the solution you'd like As a follow-up to issue #2236, we need to group different tests together based on their thread affinity. The goal is to ensure that certain tests run on the same threads to avoid race conditions and improve the reliability of our test suite. This approach will help maintain stability when tests are run in parallel by reducing potential interference between tests that share resources.

Describe alternatives you've considered Before parallelization, the test run time was 20 minutes. However, after PR #2490, it has been reduced to 4 minutes.

Potential internship candidates Please read this if you are planning to apply for a Palisadoes Foundation internship https://github.com/PalisadoesFoundation/talawa/issues/359

syedali237 avatar Aug 30 '24 14:08 syedali237