TestProtocolClient.writeOutcome() removes items from self.errors and self.failures via TestProtocolClient._filterErrors(). This makes wasSuccessful() inappropriately return True even if there were errors or failures. subunit.run.runTests() uses wasSuccessful() to determine the exit code. To fix this, we should not remove items from self.errors or self.failures, but instead use another method to keep track of how many items we have already processed in each of self.errors and self.failures. This is a regression introduced by commit 421dc7fc4d83629d3a5f9e558d378f44c7b9dad3.