This is causing more than 100 semaphores to be left on the system, eventually causing apache2 failing to start (and thus the layout test run to abort) with this error: [error] (28)No space left on device: Cannot create SSLMutex A workaround is executing this command, which fixes it for two days, but this is not sustainable: $ ipcs -s | grep chrome-bot | perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}' We should figure out how to make apache properly clean up the semaphores, as this is causing too much flakiness.
Just writing down some of my findings. Android controls the HTTP server not through Port.start_http_server() and Port.stop_http_server(), like other ports, but instead does so in Port.setup_test_run() and Port.clean_up_test_run(). The comment mentions that we do this because the HTTP server is needed during the whole test-run. Looking at the test output, it seems like the Manager._clean_up_run() method is not being called for runs which fail with an exception. Therefore we cannot gracefully shut down the HTTP server. This would explain the ipc semaphores not being removed. It seems like {clean_up,setup}_test_run() is called once per execution of the test runner, whereas the {start,stop}_http_server() methods are called once per run. For example, if we have to retry failing tests, the server would be started again. While this may introduce some delay, the benefit of not changing behavior is that the HTTP server would be shut down in the finally clause of a try/catch block, making it much more likely that it can gracefully shutdown. I'm going to upload a patch to revert our behavior to be in-line with other ports. Xianzhu, since you wrote this code, could you maybe comment on whether there are other issues I'm forgetting here?
Created attachment 171865 [details] Patch
(In reply to comment #1) > I'm going to upload a patch to revert our behavior to be in-line with other ports. Xianzhu, since you wrote this code, could you maybe comment on whether there are other issues I'm forgetting here? Your patch looks good to me. Thanks. Haven't seen other issue.
Created attachment 171880 [details] Patch
Comment on attachment 171880 [details] Patch seems reasonable.
Comment on attachment 171880 [details] Patch Clearing flags on attachment: 171880 Committed r133200: <http://trac.webkit.org/changeset/133200>
All reviewed patches have been landed. Closing bug.