2010-04-28 Eric Seidel <eric@webkit.org>
[WebKit-https.git] / WebKitTools / Scripts / webkitpy / layout_tests / layout_package / dump_render_tree_thread.py
index 462a34b..6957fcd 100644 (file)
@@ -155,7 +155,8 @@ class SingleTestThread(threading.Thread):
 
     def run(self):
         test_info = self._test_info
-        driver = self._port.start_driver(self._image_path, self._shell_args)
+        driver = self._port.create_driver(self._image_path, self._shell_args)
+        driver.start()
         start = time.time()
         crash, timeout, actual_checksum, output, error = \
             driver.run_test(test_info.uri.strip(), test_info.timeout,
@@ -446,9 +447,11 @@ class TestShellThread(threading.Thread):
         a separate DumpRenderTree in their own thread.
 
         """
+        # poll() is not threadsafe and can throw OSError due to:
+        # http://bugs.python.org/issue1731717
         if (not self._driver or self._driver.poll() is not None):
-            self._driver = self._port.start_driver(
-                self._image_path, self._shell_args)
+            self._driver = self._port.create_driver(self._image_path, self._shell_args)
+            self._driver.start()
 
     def _kill_dump_render_tree(self):
         """Kill the DumpRenderTree process if it's running."""