test_hung_server: update comments, remove dead "stage_4_d" code

This commit is contained in:
Brian Warner 2010-08-04 00:28:00 -07:00
parent 919938dd95
commit abcd6e0e96

View File

@ -122,12 +122,9 @@ class HungServerDownloadTest(GridTestMixin, ShouldFailMixin, PollMixin,
n = self.c0.create_node_from_uri(self.uri)
if self.mutable:
d = n.download_best_version()
stage_4_d = None # currently we aren't doing any tests which require this for mutable files
else:
d = download_to_data(n)
#stage_4_d = n._downloader._all_downloads.keys()[0]._stage_4_d # too ugly! FIXME
stage_4_d = None
return (d, stage_4_d,)
return d
def _wait_for_data(self, n):
if self.mutable:
@ -143,7 +140,7 @@ class HungServerDownloadTest(GridTestMixin, ShouldFailMixin, PollMixin,
self.failUnlessEqual(resultingdata, immutable_plaintext)
def _download_and_check(self):
d, stage4d = self._start_download()
d = self._start_download()
d.addCallback(self._check)
return d
@ -215,8 +212,6 @@ class HungServerDownloadTest(GridTestMixin, ShouldFailMixin, PollMixin,
d.addCallback(lambda ign: self._should_fail_download())
return d
# The tests below do not currently pass for mutable files.
def test_3_good_7_hung_immutable(self):
d = defer.succeed(None)
d.addCallback(lambda ign: self._set_up(False, "test_3_good_7_hung"))
@ -281,14 +276,6 @@ class HungServerDownloadTest(GridTestMixin, ShouldFailMixin, PollMixin,
d.addCallback(_check_done)
return d
def test_3_good_7_hung_mutable(self):
raise unittest.SkipTest("still broken")
d = defer.succeed(None)
d.addCallback(lambda ign: self._set_up(True, "test_3_good_7_hung"))
d.addCallback(lambda ign: self._hang(self.servers[3:]))
d.addCallback(lambda ign: self._download_and_check())
return d
def test_2_good_8_hung_then_1_recovers_immutable(self):
d = defer.succeed(None)
d.addCallback(lambda ign: self._set_up(False, "test_2_good_8_hung_then_1_recovers"))
@ -298,16 +285,6 @@ class HungServerDownloadTest(GridTestMixin, ShouldFailMixin, PollMixin,
d.addCallback(lambda ign: self._download_and_check())
return d
def test_2_good_8_hung_then_1_recovers_mutable(self):
raise unittest.SkipTest("still broken")
d = defer.succeed(None)
d.addCallback(lambda ign: self._set_up(True, "test_2_good_8_hung_then_1_recovers"))
d.addCallback(lambda ign: self._hang(self.servers[2:3]))
d.addCallback(lambda ign: self._hang(self.servers[3:]))
d.addCallback(lambda ign: self._unhang(self.servers[2:3]))
d.addCallback(lambda ign: self._download_and_check())
return d
def test_2_good_8_hung_then_1_recovers_with_2_shares_immutable(self):
d = defer.succeed(None)
d.addCallback(lambda ign: self._set_up(False, "test_2_good_8_hung_then_1_recovers_with_2_shares"))
@ -318,6 +295,28 @@ class HungServerDownloadTest(GridTestMixin, ShouldFailMixin, PollMixin,
d.addCallback(lambda ign: self._download_and_check())
return d
# The tests below do not currently pass for mutable files. The
# mutable-file downloader does not yet handle hung servers, and the tests
# hang forever (hence the use of SkipTest rather than .todo)
def test_3_good_7_hung_mutable(self):
raise unittest.SkipTest("still broken")
d = defer.succeed(None)
d.addCallback(lambda ign: self._set_up(True, "test_3_good_7_hung"))
d.addCallback(lambda ign: self._hang(self.servers[3:]))
d.addCallback(lambda ign: self._download_and_check())
return d
def test_2_good_8_hung_then_1_recovers_mutable(self):
raise unittest.SkipTest("still broken")
d = defer.succeed(None)
d.addCallback(lambda ign: self._set_up(True, "test_2_good_8_hung_then_1_recovers"))
d.addCallback(lambda ign: self._hang(self.servers[2:3]))
d.addCallback(lambda ign: self._hang(self.servers[3:]))
d.addCallback(lambda ign: self._unhang(self.servers[2:3]))
d.addCallback(lambda ign: self._download_and_check())
return d
def test_2_good_8_hung_then_1_recovers_with_2_shares_mutable(self):
raise unittest.SkipTest("still broken")
d = defer.succeed(None)