The shardTestFiles option is a useful feature, however it can cause test failures when running specs that can't run in parallel against a common server. This may be bad practice for the tests, nonetheless the tests run fine when run sequentially.
We still have plenty of 'read only' specs that can run in parallel however. What we'd like to do is run a set of 'read only' tests in parallel against the server then a set of 'read write' tests sequentially, but not have the 'read only' and 'read write' tests running at the same time.
For example it might be implemented by adding a 'maxSessions' per capability, something like (commented out pseudo options):
multiCapabilities: [
{
shardTestFiles: true,
maxInstances: 4,
//maxSessions: -1,
//parallelCapability: true
browserName: chrome,
specs: ['readonly/*.spec.js']
},
{
shardTestFiles: false,
maxInstances: 1,
//maxSessions: 1,
//sequential: true
//parallelCapability: false
browserName: chrome,
specs: ['readwrite/*.spec.js']
}
],
It can be worked around by having two protractor.conf.js files and running them separately and sequentially, but it's not ideal.