(int status)
| 109 | } |
| 110 | |
| 111 | private static void exit(int status) throws Exception { |
| 112 | if (zkserver != null) { |
| 113 | zkserver.stop(); |
| 114 | } |
| 115 | // For this test to pass reliably on some platforms, this sleep is |
| 116 | // required to ensure that the test server shutdown is complete |
| 117 | // before the JVM starts running native object destructors after |
| 118 | // System.exit() is called. 500ms proved successful in test runs, |
| 119 | // but on a heavily loaded machine it might not. |
| 120 | // TODO(greg): Ideally, we would inspect the status of the server |
| 121 | // via the Java API and wait until its teardown is complete to |
| 122 | // exit. |
| 123 | Thread.sleep(500); |
| 124 | |
| 125 | System.exit(status); |
| 126 | } |
| 127 | |
| 128 | public static void main(String[] args) throws Exception { |
| 129 | if (args.length < 3) { |
no test coverage detected