d = self.set_up_nodes()
def _check_connections(res):
for c in self.clients:
+ c.DEFAULT_ENCODING_PARAMETERS['happy'] = 5
all_peerids = c.get_storage_broker().get_all_serverids()
self.failUnlessEqual(len(all_peerids), self.numclients)
sb = c.storage_broker
add_to_sparent=True))
def _added(extra_node):
self.extra_node = extra_node
+ self.extra_node.DEFAULT_ENCODING_PARAMETERS['happy'] = 5
d.addCallback(_added)
HELPER_DATA = "Data that needs help to upload" * 1000
self.basedir = "system/SystemTest/test_filesystem"
self.data = LARGE_DATA
d = self.set_up_nodes(use_stats_gatherer=True)
+ def _new_happy_semantics(ign):
+ for c in self.clients:
+ c.DEFAULT_ENCODING_PARAMETERS['happy'] = 1
+ d.addCallback(_new_happy_semantics)
d.addCallback(self._test_introweb)
d.addCallback(self.log, "starting publish")
d.addCallback(self._do_publish1)
d.addCallback(self.failUnlessEqual, "new.txt contents")
# and again with something large enough to use multiple segments,
# and hopefully trigger pauseProducing too
+ def _new_happy_semantics(ign):
+ for c in self.clients:
+ # these get reset somewhere? Whatever.
+ c.DEFAULT_ENCODING_PARAMETERS['happy'] = 1
+ d.addCallback(_new_happy_semantics)
d.addCallback(lambda res: self.PUT(public + "/subdir3/big.txt",
"big" * 500000)) # 1.5MB
d.addCallback(lambda res: self.GET(public + "/subdir3/big.txt"))
class FakeClient:
DEFAULT_ENCODING_PARAMETERS = {"k":25,
- "happy": 75,
+ "happy": 25,
"n": 100,
"max_segment_size": 1*MiB,
}
data = self.get_data(SIZE_LARGE)
segsize = int(SIZE_LARGE / 2.5)
# we want 3 segments, since that's not a power of two
- self.set_encoding_parameters(25, 75, 100, segsize)
+ self.set_encoding_parameters(25, 25, 100, segsize)
d = upload_data(self.u, data)
d.addCallback(extract_uri)
d.addCallback(self._check_large, SIZE_LARGE)
def test_first_error(self):
mode = dict([(0,"good")] + [(i,"first-fail") for i in range(1,10)])
self.make_node(mode)
+ self.set_encoding_parameters(k=25, happy=1, n=50)
d = upload_data(self.u, DATA)
d.addCallback(extract_uri)
d.addCallback(self._check_large, SIZE_LARGE)
self.make_client()
data = self.get_data(SIZE_LARGE)
- self.set_encoding_parameters(50, 75, 100)
+ # if there are 50 peers, then happy needs to be <= 50
+ self.set_encoding_parameters(50, 50, 100)
d = upload_data(self.u, data)
d.addCallback(extract_uri)
d.addCallback(self._check_large, SIZE_LARGE)
self.make_client()
data = self.get_data(SIZE_LARGE)
- self.set_encoding_parameters(100, 150, 200)
+ # if there are 50 peers, then happy should be no more than 50 if
+ # we want this to work.
+ self.set_encoding_parameters(100, 50, 200)
d = upload_data(self.u, data)
d.addCallback(extract_uri)
d.addCallback(self._check_large, SIZE_LARGE)
self.make_client(3)
data = self.get_data(SIZE_LARGE)
- self.set_encoding_parameters(3, 5, 10)
+ self.set_encoding_parameters(3, 3, 10)
d = upload_data(self.u, data)
d.addCallback(extract_uri)
d.addCallback(self._check_large, SIZE_LARGE)