Ticket #1389: 1389-add-test.darcs.patch

File 1389-add-test.darcs.patch, 8.2 KB (added by zooko, at 2011-04-10T12:03:02Z)
Line 
11 patch for repository /Users/zooko/playground/tahoe-lafs/pristine:
2
3Sun Apr 10 06:01:30 MDT 2011  zooko@zooko.com
4  * tests: add test for including ImportError message in the summary of dependencies
5  refs. #1389
6
7New patches:
8
9[tests: add test for including ImportError message in the summary of dependencies
10zooko@zooko.com**20110410120130
11 Ignore-this: 581b37aaba6ee00fea8d0beea45d556c
12 refs. #1389
13] {
14addfile ./src/allmydata/test/test_package_initialization.py
15hunk ./src/allmydata/test/test_package_initialization.py 1
16+
17+from twisted.trial import unittest
18+
19+import allmydata
20+
21+import sys
22+
23+class T(unittest.TestCase):
24+    def test_report_import_error(self):
25+        try:
26+            real_import_func = __builtins__['__import__']
27+
28+            def raiseIE(name, *args):
29+                if name == "foolscap":
30+                    raise ImportError("wheeeyo foolscap cant be imported")
31+                else:
32+                    return real_import_func(name, *args)
33+
34+            __builtins__['__import__'] = raiseIE
35+            vers_and_locs =  allmydata.get_package_versions_and_locations()
36+            for (pkgname, stuff) in vers_and_locs:
37+                if pkgname == 'foolscap':
38+                    self.failUnless('wheeeyo' in stuff[2], stuff)
39+        finally:
40+            __builtins__['__import__'] = real_import_func
41}
42
43Context:
44
45[remove unused variable detected by pyflakes
46zooko@zooko.com**20110407172231
47 Ignore-this: 7344652d5e0720af822070d91f03daf9
48]
49[allmydata/__init__.py: Nicer reporting of unparseable version numbers in dependencies. fixes #1388
50david-sarah@jacaranda.org**20110401202750
51 Ignore-this: 9c6bd599259d2405e1caadbb3e0d8c7f
52]
53[update FTP-and-SFTP.rst: the necessary patch is included in Twisted-10.1
54Brian Warner <warner@lothar.com>**20110325232511
55 Ignore-this: d5307faa6900f143193bfbe14e0f01a
56]
57[control.py: remove all uses of s.get_serverid()
58warner@lothar.com**20110227011203
59 Ignore-this: f80a787953bd7fa3d40e828bde00e855
60]
61[web: remove some uses of s.get_serverid(), not all
62warner@lothar.com**20110227011159
63 Ignore-this: a9347d9cf6436537a47edc6efde9f8be
64]
65[immutable/downloader/fetcher.py: remove all get_serverid() calls
66warner@lothar.com**20110227011156
67 Ignore-this: fb5ef018ade1749348b546ec24f7f09a
68]
69[immutable/downloader/fetcher.py: fix diversity bug in server-response handling
70warner@lothar.com**20110227011153
71 Ignore-this: bcd62232c9159371ae8a16ff63d22c1b
72 
73 When blocks terminate (either COMPLETE or CORRUPT/DEAD/BADSEGNUM), the
74 _shares_from_server dict was being popped incorrectly (using shnum as the
75 index instead of serverid). I'm still thinking through the consequences of
76 this bug. It was probably benign and really hard to detect. I think it would
77 cause us to incorrectly believe that we're pulling too many shares from a
78 server, and thus prefer a different server rather than asking for a second
79 share from the first server. The diversity code is intended to spread out the
80 number of shares simultaneously being requested from each server, but with
81 this bug, it might be spreading out the total number of shares requested at
82 all, not just simultaneously. (note that SegmentFetcher is scoped to a single
83 segment, so the effect doesn't last very long).
84]
85[immutable/downloader/share.py: reduce get_serverid(), one left, update ext deps
86warner@lothar.com**20110227011150
87 Ignore-this: d8d56dd8e7b280792b40105e13664554
88 
89 test_download.py: create+check MyShare instances better, make sure they share
90 Server objects, now that finder.py cares
91]
92[immutable/downloader/finder.py: reduce use of get_serverid(), one left
93warner@lothar.com**20110227011146
94 Ignore-this: 5785be173b491ae8a78faf5142892020
95]
96[immutable/offloaded.py: reduce use of get_serverid() a bit more
97warner@lothar.com**20110227011142
98 Ignore-this: b48acc1b2ae1b311da7f3ba4ffba38f
99]
100[immutable/upload.py: reduce use of get_serverid()
101warner@lothar.com**20110227011138
102 Ignore-this: ffdd7ff32bca890782119a6e9f1495f6
103]
104[immutable/checker.py: remove some uses of s.get_serverid(), not all
105warner@lothar.com**20110227011134
106 Ignore-this: e480a37efa9e94e8016d826c492f626e
107]
108[add remaining get_* methods to storage_client.Server, NoNetworkServer, and
109warner@lothar.com**20110227011132
110 Ignore-this: 6078279ddf42b179996a4b53bee8c421
111 MockIServer stubs
112]
113[upload.py: rearrange _make_trackers a bit, no behavior changes
114warner@lothar.com**20110227011128
115 Ignore-this: 296d4819e2af452b107177aef6ebb40f
116]
117[happinessutil.py: finally rename merge_peers to merge_servers
118warner@lothar.com**20110227011124
119 Ignore-this: c8cd381fea1dd888899cb71e4f86de6e
120]
121[test_upload.py: factor out FakeServerTracker
122warner@lothar.com**20110227011120
123 Ignore-this: 6c182cba90e908221099472cc159325b
124]
125[test_upload.py: server-vs-tracker cleanup
126warner@lothar.com**20110227011115
127 Ignore-this: 2915133be1a3ba456e8603885437e03
128]
129[happinessutil.py: server-vs-tracker cleanup
130warner@lothar.com**20110227011111
131 Ignore-this: b856c84033562d7d718cae7cb01085a9
132]
133[upload.py: more tracker-vs-server cleanup
134warner@lothar.com**20110227011107
135 Ignore-this: bb75ed2afef55e47c085b35def2de315
136]
137[upload.py: fix var names to avoid confusion between 'trackers' and 'servers'
138warner@lothar.com**20110227011103
139 Ignore-this: 5d5e3415b7d2732d92f42413c25d205d
140]
141[refactor: s/peer/server/ in immutable/upload, happinessutil.py, test_upload
142warner@lothar.com**20110227011100
143 Ignore-this: 7ea858755cbe5896ac212a925840fe68
144 
145 No behavioral changes, just updating variable/method names and log messages.
146 The effects outside these three files should be minimal: some exception
147 messages changed (to say "server" instead of "peer"), and some internal class
148 names were changed. A few things still use "peer" to minimize external
149 changes, like UploadResults.timings["peer_selection"] and
150 happinessutil.merge_peers, which can be changed later.
151]
152[storage_client.py: clean up test_add_server/test_add_descriptor, remove .test_servers
153warner@lothar.com**20110227011056
154 Ignore-this: efad933e78179d3d5fdcd6d1ef2b19cc
155]
156[test_client.py, upload.py:: remove KiB/MiB/etc constants, and other dead code
157warner@lothar.com**20110227011051
158 Ignore-this: dc83c5794c2afc4f81e592f689c0dc2d
159]
160[test: increase timeout on a network test because Francois's ARM machine hit that timeout
161zooko@zooko.com**20110317165909
162 Ignore-this: 380c345cdcbd196268ca5b65664ac85b
163 I'm skeptical that the test was proceeding correctly but ran out of time. It seems more likely that it had gotten hung. But if we raise the timeout to an even more extravagant number then we can be even more certain that the test was never going to finish.
164]
165[docs/configuration.rst: add a "Frontend Configuration" section
166Brian Warner <warner@lothar.com>**20110222014323
167 Ignore-this: 657018aa501fe4f0efef9851628444ca
168 
169 this points to docs/frontends/*.rst, which were previously underlinked
170]
171[web/filenode.py: avoid calling req.finish() on closed HTTP connections. Closes #1366
172"Brian Warner <warner@lothar.com>"**20110221061544
173 Ignore-this: 799d4de19933f2309b3c0c19a63bb888
174]
175[Add unit tests for cross_check_pkg_resources_versus_import, and a regression test for ref #1355. This requires a little refactoring to make it testable.
176david-sarah@jacaranda.org**20110221015817
177 Ignore-this: 51d181698f8c20d3aca58b057e9c475a
178]
179[allmydata/__init__.py: .name was used in place of the correct .__name__ when printing an exception. Also, robustify string formatting by using %r instead of %s in some places. fixes #1355.
180david-sarah@jacaranda.org**20110221020125
181 Ignore-this: b0744ed58f161bf188e037bad077fc48
182]
183[Refactor StorageFarmBroker handling of servers
184Brian Warner <warner@lothar.com>**20110221015804
185 Ignore-this: 842144ed92f5717699b8f580eab32a51
186 
187 Pass around IServer instance instead of (peerid, rref) tuple. Replace
188 "descriptor" with "server". Other replacements:
189 
190  get_all_servers -> get_connected_servers/get_known_servers
191  get_servers_for_index -> get_servers_for_psi (now returns IServers)
192 
193 This change still needs to be pushed further down: lots of code is now
194 getting the IServer and then distributing (peerid, rref) internally.
195 Instead, it ought to distribute the IServer internally and delay
196 extracting a serverid or rref until the last moment.
197 
198 no_network.py was updated to retain parallelism.
199]
200[TAG allmydata-tahoe-1.8.2
201warner@lothar.com**20110131020101]
202Patch bundle hash:
203db7afa66ac409d5101296348a7fa583d78b0be9b