pants icon indicating copy to clipboard operation
pants copied to clipboard

Enroll more backends into retries for failed tests

Open lilatomic opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. We now have machinery to retry failed tests. Each backend need to opt into this feature.

Describe the solution you'd like It is done by wrapping their test processes in a ProcessWithRetries:

    results = await Get(
        ProcessResultWithRetries,
        ProcessWithRetries(setup.process, test_subsystem.attempts_default),
    )

and then using the last result if needed

last_result = results.last
...
        coverage_snapshot = await Get(
            Snapshot, DigestSubset(last_result.output_digest, PathGlobs([".coverage"]))
        )

Relevant backends

Potentially relevant files (searching for -> TestResult and filtering out some irrelevant ones):

  • [ ] src/python/pants/backend/helm/test/unittest.py
  • [ ] src/python/pants/backend/javascript/goals/test.py
  • [ ] src/python/pants/backend/scala/test/scalatest.py
  • [ ] src/python/pants/backend/shell/goals/test.py
  • [ ] src/python/pants/backend/shell/shunit2_test_runner.py
  • [ ] src/python/pants/backend/go/goals/test.py
  • [ ] src/python/pants/jvm/test/testutil.py
  • [ ] src/python/pants/jvm/test/junit.py

lilatomic avatar Jan 08 '24 08:01 lilatomic

I've done a search for -> TestResult and put in what seem like the relevant files for updating. Please feel free to fix that up.

huonw avatar Jan 09 '24 21:01 huonw