Changeset 136314 in webkit
- Timestamp:
- Dec 1, 2012 11:06:01 PM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r136308 r136314 1 2012-12-01 Zan Dobersek <zandobersek@gmail.com> 2 3 [XvfbDriver] XvfbDriverTest.test_next_free_display is flaky on builders using XvfbDriver 4 https://bugs.webkit.org/show_bug.cgi?id=103806 5 6 Reviewed by Dirk Pranke. 7 8 There are occasional mishaps on builders where XvfbDriver doesn't properly 9 clean up the Xvfb instance it was managing so the related guard lock files 10 are still existing when the webkitpy unit tests are run. This can cause failures 11 in XvfbDriverTest.test_next_free_display as the test tries to acquire displays 12 with a specific number but is unable to due to the stale locks. 13 14 The solution to this is to use MockFileLock when inside unit test. This is achievable 15 by creating a file lock through the SystemHost instance connected to the Port object, 16 the latter available to the Driver. 17 18 * Scripts/webkitpy/common/system/file_lock_mock.py: 19 (MockFileLock.acquire_lock): Return True to signal lock acquiring succeeded. 20 (MockFileLock.release_lock): Return True to signal lock releasing succeeded. 21 * Scripts/webkitpy/layout_tests/port/xvfbdriver.py: 22 (XvfbDriver._next_free_display): Create the file lock through a mockable way. 23 * Scripts/webkitpy/layout_tests/port/xvfbdriver_unittest.py: 24 (XvfbDriverTest.test_next_free_display): Enable back the unit test. 25 1 26 2012-12-01 Zan Dobersek <zandobersek@gmail.com> 2 27 -
trunk/Tools/Scripts/webkitpy/common/system/file_lock_mock.py
r133508 r136314 31 31 32 32 def acquire_lock(self): 33 pass33 return True 34 34 35 35 def release_lock(self): 36 pass36 return True -
trunk/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py
r133050 r136314 55 55 if i not in reserved_screens: 56 56 _guard_lock_file = self._port.host.filesystem.join('/tmp', 'WebKitXvfb.lock.%i' % i) 57 self._guard_lock = FileLock(_guard_lock_file)57 self._guard_lock = self._port.host.make_file_lock(_guard_lock_file) 58 58 if self._guard_lock.acquire_lock(): 59 59 return i -
trunk/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver_unittest.py
r135912 r136314 83 83 self.cleanup_driver(driver) 84 84 85 def disabled_test_next_free_display(self):85 def test_next_free_display(self): 86 86 output = "Xorg /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch -background none\nXvfb Xvfb :1 -screen 0 800x600x24 -nolisten tcp" 87 87 executive = MockExecutive2(output)
Note: See TracChangeset
for help on using the changeset viewer.