Currently when Apex tests are run in parallel there is no control over how many tests run at any one point in time.
Using the following SOQL query against the Tooling API I've observed around 30 tests running simultaneously (Summer '18).
Select Id, ApexClassId, Status, ExtendedStatus, ParentJobId, TestRunResultId, ShouldSkipCodeCoverage from ApexTestQueueItem where Status = 'Processing'
With larger orgs that are more complex this can often result in UNABLE_TO_LOCK_ROW
and "connection was cancelled here"
errors. Disabling parallel testing is one way to avoid this problem, but it can greatly increase the time required to run all the tests in an org.
Instead, allow the degree of parallelism in testing supported by the org to be configured. If the number of supported threads could be reduced to, say, 2 tests running at any point in time then the odds of locking/race conditions could be greatly reduced while still allowing for a greater throughput of test classes.