Verify that X launched, instead of sleeping through a race condition
When X has partially launched, wflinfo fails and kills the build. Rather than sleeping for an arbitrary number of seconds, test that X has launched by using the same wflinfo invocation.
If X is still launching, progressively delay until launch is complete. Limit the total delay to a reasonable amount (1 minute).