Error running `run_tests` task
cdelmoral opened this issue · comments
Describe the bug
When running a lot of apex tests in parallel some tests may fail with the following error:
Could not run tests on class <ApexClassId> because: connection was cancelled here
Sometimes when this happens the ApexTestResult.MethodName
will be empty, as can be seen in the following screenshots:
I'm not sure if this happens for a specific reason, but I wasn't able to consistently get an empty ApexTestResult.MethodName
back.
In any case, this makes the following line throw an exception: testrunner.py#L417, since the test results are tracked by MethodName
testrunner.py#L346-L348.
Possible solutions could be:
- Handle the
None
cases when sorting the list of method names - Not adding test results to the dictionary when
MethodName
isNone
- Add a filter to this query to only query results with a
MethodName
defined
Let me know if there is a preference, happy to get a pull request started.
Reproduction steps
- Run a lot of apex tests in parallel using the task
run_tests
, so that some of them fail withCould not run tests on class <ApexClassId> because: connection was cancelled here
- If one of the failed
ApexTestResult
has an emptyMethodName
, continue, otherwise start from the beginning
Expected behavior:
- Test results are displayed correctly and the task
run_tests
finishes without throwing an exception
Actual behavior:
- Processing the test results throws an exception
Your CumulusCI and Python versions
$ cci version
CumulusCI version: 3.75.1 (~/.pyenv/versions/3.9.13/bin/cci)
Python version: 3.9.13 (~/.pyenv/versions/3.9.13/bin/python3.9)
Operating System
macOS Ventura 13.2.1
Windows environment
No response
CumulusCI installation method
None
Error Gist
No response
Additional information
No response