-
-
Notifications
You must be signed in to change notification settings - Fork 331
Enable stateful tests for LocalStore #2804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d740c7a
83a91c9
01edfca
4571884
d6fe75e
b5cbf25
950f6d8
46382fc
f85e028
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
:py:class:`LocalStore` learned to ``delete_dir``. This makes array and group deletes more efficient. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import sys | ||
from typing import Any | ||
|
||
import hypothesis.extra.numpy as npst | ||
|
@@ -209,7 +210,7 @@ | |
|
||
|
||
def key_ranges( | ||
keys: SearchStrategy = node_names, max_size: int | None = None | ||
keys: SearchStrategy = node_names, max_size: int = sys.maxsize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is part of our public API, so changing the default here is an API change. What was the motivation for changing it - does hypothesis not work well with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cleans up the use of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
) -> SearchStrategy[list[int]]: | ||
""" | ||
Function to generate key_ranges strategy for get_partial_values() | ||
|
@@ -218,10 +219,14 @@ | |
[(key, (range_start, range_end)), | ||
(key, (range_start, range_end)),...] | ||
""" | ||
|
||
def make_request(start: int, length: int) -> RangeByteRequest: | ||
return RangeByteRequest(start, end=min(start + length, max_size)) | ||
dcherian marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
byte_ranges = st.builds( | ||
RangeByteRequest, | ||
make_request, | ||
start=st.integers(min_value=0, max_value=max_size), | ||
end=st.integers(min_value=0, max_value=max_size), | ||
length=st.integers(min_value=0, max_value=max_size), | ||
) | ||
key_tuple = st.tuples(keys, byte_ranges) | ||
return st.lists(key_tuple, min_size=1, max_size=10) |
Uh oh!
There was an error while loading. Please reload this page.