Skip to content

Commit

Permalink
Merge pull request #1333 from tahoe-lafs/4063-pypy-test-failure
Browse files Browse the repository at this point in the history
Make tests pass again

Fixes ticket:4063
  • Loading branch information
itamarst committed Sep 13, 2023
2 parents 1464202 + 7d7ca29 commit ef20422
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Empty file added newsfragments/4063.minor
Empty file.
20 changes: 18 additions & 2 deletions src/allmydata/test/test_storage_http.py
Expand Up @@ -1673,10 +1673,12 @@ def check_bad_range(bad_range_value):
# semantically valid under HTTP.
check_bad_range("bytes=0-")

@given(data_length=st.integers(min_value=1, max_value=300000))
def test_read_with_no_range(self, data_length):
def _read_with_no_range_test(self, data_length):
"""
A read with no range returns the whole mutable/immutable.
Actual test is defined in subclasses, to fix complaints from Hypothesis
about the method having different executors.
"""
storage_index, uploaded_data, _ = self.upload(1, data_length)
response = self.http.result_of_with_flush(
Expand Down Expand Up @@ -1770,6 +1772,13 @@ def upload(self, share_number, data_length=26):
def get_leases(self, storage_index):
return self.http.storage_server.get_leases(storage_index)

@given(data_length=st.integers(min_value=1, max_value=300000))
def test_read_with_no_range(self, data_length):
"""
A read with no range returns the whole immutable.
"""
return self._read_with_no_range_test(data_length)


class MutableSharedTests(SharedImmutableMutableTestsMixin, SyncTestCase):
"""Shared tests, running on mutables."""
Expand Down Expand Up @@ -1809,3 +1818,10 @@ def upload(self, share_number, data_length=26):

def get_leases(self, storage_index):
return self.http.storage_server.get_slot_leases(storage_index)

@given(data_length=st.integers(min_value=1, max_value=300000))
def test_read_with_no_range(self, data_length):
"""
A read with no range returns the whole mutable.
"""
return self._read_with_no_range_test(data_length)

0 comments on commit ef20422

Please sign in to comment.