title: Unit testing: "Too many open files" and "Too many connections" errors after upgrade to symfony 2.5
body: <p>It looks like some system resources are holding in Symfony 2.5 while tests are running.</p>
  
  <p>I have a Symfony2 project with more than 200 functional tests. 
  With Symfony 2.3 and 2.4 everything worked, but after upgrade to 2.5 I began receiving an error (I use Mac OS X):</p>
  
  <pre><code>failed to open stream: Too many open files
  </code></pre>
  
  <p>I googled a little and changed max_files parameter in system config.</p>
  
  <p>After that I began receiving another error:</p>
  
  <pre><code>Uncaught exception 'PDOException' with message 'SQLSTATE[08004] [1040] Too many connections'
  </code></pre>
  
  <p>OK, I changed the max-connections parameter in MySQL, but it looks like something is wrong after upgrade. Like some system resources are holding. </p>
  
  <p>After downgrade back to 2.4 everything becomes OK again.</p>
  
  <p>Maybe now I have to close some resources or connections manually somewhere? Or the problem is somewhere else?</p>
  
  <p>UPD: I have found one more question with same problem: <a href="https://stackoverflow.com/questions/21182087/too-many-connection-during-unit-testing">Too many connection during unit testing</a></p>