openshift/origin-server — pull request #777 by rmillner (2012-10-26 21:10:24+00:00)
Title: BZ 869862: Fix race conditions between tests with the same type of application

Tests which use the same type of application (commonly, PHP) are likely to step on each other and exhibit race conditions. The algorithm being used to find the correct application will always return the application with the lowest numbered randomly generated domain name rather than the one which was created for any specific test.

This leads to, for example, race conditions where one test is trying to perform an action (ex: restart, tidy) on an application that hasn't even finished configuring yet (BZ 869862).

It was determined that every test which looks for an application of a specific type also creates and destroys the application it expects to find. Applications are expected to be associated with the test that's running them.

The way cucumber tests run, no global (ex: @app or @apps) survive from scenario to scenario; so the applications are associated to the process ID of the test which created them.