title: How do I wait until a console application is idle?
body: <p>I have a console application that starts up, hosts a bunch of services (long-running startup), and then waits for clients to call into it. I have integration tests that start this console application and make "client" calls. How do I wait for the console application to complete its startup before making the client calls?</p>
  
  <p>I want to avoid doing <code>Thread.Sleep(int)</code> because that's dependent on the startup time (which may change) and I waste time if the startup is <em>faster</em>.</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.waitforinputidle.aspx" rel="noreferrer"><code>Process.WaitForInputIdle</code></a> works only on applications with a UI (and I confirmed that it does throw an exception in this case).</p>
  
  <p>I'm open to awkward solutions like, <em>have the console application write a temp file when it's ready.</em></p>