Merge lp:~lifeless/bzr/shelve-locks into lp:~bzr/bzr/trunk-old

Proposed by Robert Collins
Status: Merged
Merged at revision: not available
Proposed branch: lp:~lifeless/bzr/shelve-locks
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 103 lines
To merge this branch: bzr merge lp:~lifeless/bzr/shelve-locks
Reviewer Review Type Date Requested Status
bzr-core Pending
Review via email: mp+10704@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

[MERGE] Improve behaviour of tests that have a reasonable excuse for
causing locking issues on windows selftest.

These tests test things that are hard to test well today, without losing
coverage. They shouldn't cause errors or issues on windows though, so
guard them appropriately.

-Rob

--

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
> Robert Collins has proposed merging lp:~lifeless/bzr/shelve-locks into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
> [MERGE] Improve behaviour of tests that have a reasonable excuse for
> causing locking issues on windows selftest.
>
> These tests test things that are hard to test well today, without losing
> coverage. They shouldn't cause errors or issues on windows though, so
> guard them appropriately.
>
> -Rob
>
>

I think this is supposed to be an incremental update from the original
shelve changes, fixing a couple tests. However, this is really hard to
read with all of the shelve changes mixed in.

Am I understanding it correctly, and I can just wait for bzr.dev to
catch up and resubmit it later?

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqUlW0ACgkQJdeBCYSNAANRHwCcCpl4j7UcOGoZZtZka8OGGdFg
xHIAoJONH6ayNBtckLxzeBAqc0rDJBxJ
=2Q5G
-----END PGP SIGNATURE-----

Revision history for this message
Robert Collins (lifeless) wrote :
Download full text (4.6 KiB)

On Wed, 2009-08-26 at 01:54 +0000, John A Meinel wrote:

> I think this is supposed to be an incremental update from the original
> shelve changes, fixing a couple tests. However, this is really hard to
> read with all of the shelve changes mixed in.

aye

> Am I understanding it correctly, and I can just wait for bzr.dev to
> catch up and resubmit it later?

=== modified file 'bzrlib/tests/blackbox/test_info.py'
--- bzrlib/tests/blackbox/test_info.py 2009-08-17 03:47:03 +0000
+++ bzrlib/tests/blackbox/test_info.py 2009-08-25 23:38:10 +0000
@@ -1328,6 +1328,10 @@
     def test_info_locking_oslocks(self):
         if sys.platform == "win32":
             raise TestSkipped("don't use oslocks on win32 in unix
manner")
+ # This test tests old (all-in-one, OS lock using) behaviour
which
+ # simply cannot work on windows (and is indeed why we changed
our
+ # design. As such, don't try to remove the
thisFailsStrictLockCheck
+ # call here.
         self.thisFailsStrictLockCheck()

         tree = self.make_branch_and_tree('branch',

=== modified file 'bzrlib/tests/per_workingtree/test_flush.py'
--- bzrlib/tests/per_workingtree/test_flush.py 2009-07-31 17:42:29 +0000
+++ bzrlib/tests/per_workingtree/test_flush.py 2009-08-25 23:38:10 +0000
@@ -16,7 +16,9 @@

 """Tests for WorkingTree.flush."""

+import sys
 from bzrlib import errors, inventory
+from bzrlib.tests import TestSkipped
 from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree

@@ -31,8 +33,14 @@
             tree.unlock()

     def test_flush_when_inventory_is_modified(self):
+ if sys.platform == "win32":
+ raise TestSkipped("don't use oslocks on win32 in unix
manner")
         # This takes a write lock on the source tree, then opens a
second copy
- # and tries to grab a read lock, which is a bit bogus
+ # and tries to grab a read lock. This works on Unix and is a
reasonable
+ # way to detect when the file is actually written to, but it
won't work
+ # (as a test) on Windows. It might be nice to instead stub out
the
+ # functions used to write and that way do both less work and
also be
+ # able to execute on Windows.
         self.thisFailsStrictLockCheck()
         # when doing a flush the inventory should be written if needed.
         # we test that by changing the inventory (using

=== modified file 'bzrlib/tests/per_workingtree/test_locking.py'
--- bzrlib/tests/per_workingtree/test_locking.py 2009-07-31 17:42:29
+0000
+++ bzrlib/tests/per_workingtree/test_locking.py 2009-08-25 23:38:10
+0000
@@ -16,11 +16,14 @@

 """Tests for the (un)lock interfaces on all working tree
implemenations."""

+import sys
+
 from bzrlib import (
     branch,
     errors,
     lockdir,
     )
+from bzrlib.tests import TestSkipped
 from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree

@@ -105,8 +108,14 @@

         :param methodname: The lock method to use to establish locks.
         """
- # This write locks the local tree, and then grabs a read lock
on a
- # copy, which is bogus and the test just needs to be rewritten.
+ if sys.platform == "win32":
+ raise ...

Read more...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/tests/blackbox/test_info.py'
2--- bzrlib/tests/blackbox/test_info.py 2009-08-17 03:47:03 +0000
3+++ bzrlib/tests/blackbox/test_info.py 2009-08-27 01:35:32 +0000
4@@ -1328,6 +1328,10 @@
5 def test_info_locking_oslocks(self):
6 if sys.platform == "win32":
7 raise TestSkipped("don't use oslocks on win32 in unix manner")
8+ # This test tests old (all-in-one, OS lock using) behaviour which
9+ # simply cannot work on windows (and is indeed why we changed our
10+ # design. As such, don't try to remove the thisFailsStrictLockCheck
11+ # call here.
12 self.thisFailsStrictLockCheck()
13
14 tree = self.make_branch_and_tree('branch',
15
16=== modified file 'bzrlib/tests/per_workingtree/test_flush.py'
17--- bzrlib/tests/per_workingtree/test_flush.py 2009-07-31 17:42:29 +0000
18+++ bzrlib/tests/per_workingtree/test_flush.py 2009-08-27 01:35:32 +0000
19@@ -16,7 +16,9 @@
20
21 """Tests for WorkingTree.flush."""
22
23+import sys
24 from bzrlib import errors, inventory
25+from bzrlib.tests import TestSkipped
26 from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
27
28
29@@ -31,8 +33,14 @@
30 tree.unlock()
31
32 def test_flush_when_inventory_is_modified(self):
33+ if sys.platform == "win32":
34+ raise TestSkipped("don't use oslocks on win32 in unix manner")
35 # This takes a write lock on the source tree, then opens a second copy
36- # and tries to grab a read lock, which is a bit bogus
37+ # and tries to grab a read lock. This works on Unix and is a reasonable
38+ # way to detect when the file is actually written to, but it won't work
39+ # (as a test) on Windows. It might be nice to instead stub out the
40+ # functions used to write and that way do both less work and also be
41+ # able to execute on Windows.
42 self.thisFailsStrictLockCheck()
43 # when doing a flush the inventory should be written if needed.
44 # we test that by changing the inventory (using
45
46=== modified file 'bzrlib/tests/per_workingtree/test_locking.py'
47--- bzrlib/tests/per_workingtree/test_locking.py 2009-07-31 17:42:29 +0000
48+++ bzrlib/tests/per_workingtree/test_locking.py 2009-08-27 01:35:32 +0000
49@@ -16,11 +16,14 @@
50
51 """Tests for the (un)lock interfaces on all working tree implemenations."""
52
53+import sys
54+
55 from bzrlib import (
56 branch,
57 errors,
58 lockdir,
59 )
60+from bzrlib.tests import TestSkipped
61 from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
62
63
64@@ -105,8 +108,14 @@
65
66 :param methodname: The lock method to use to establish locks.
67 """
68- # This write locks the local tree, and then grabs a read lock on a
69- # copy, which is bogus and the test just needs to be rewritten.
70+ if sys.platform == "win32":
71+ raise TestSkipped("don't use oslocks on win32 in unix manner")
72+ # This helper takes a write lock on the source tree, then opens a
73+ # second copy and tries to grab a read lock. This works on Unix and is
74+ # a reasonable way to detect when the file is actually written to, but
75+ # it won't work (as a test) on Windows. It might be nice to instead
76+ # stub out the functions used to write and that way do both less work
77+ # and also be able to execute on Windows.
78 self.thisFailsStrictLockCheck()
79 # when unlocking the last lock count from tree_write_lock,
80 # the tree should do a flush().
81
82=== modified file 'bzrlib/tests/per_workingtree/test_set_root_id.py'
83--- bzrlib/tests/per_workingtree/test_set_root_id.py 2009-08-21 01:48:13 +0000
84+++ bzrlib/tests/per_workingtree/test_set_root_id.py 2009-08-27 01:35:32 +0000
85@@ -16,13 +16,18 @@
86
87 """Tests for WorkingTree.set_root_id"""
88
89+import sys
90+
91 from bzrlib import inventory
92+from bzrlib.tests import TestSkipped
93 from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
94
95
96 class TestSetRootId(TestCaseWithWorkingTree):
97
98 def test_set_and_read_unicode(self):
99+ if sys.platform == "win32":
100+ raise TestSkipped("don't use oslocks on win32 in unix manner")
101 # This test tests that setting the root doesn't flush, so it
102 # deliberately tests concurrent access that isn't possible on windows.
103 self.thisFailsStrictLockCheck()