-
Notifications
You must be signed in to change notification settings - Fork 33
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
Make timestamp overrides optional in tests and add faketime test #1953
Merged
kounelisagis
merged 10 commits into
dev
from
agis/sc-42967/make-timestamp-overrides-optional
Apr 19, 2024
Merged
Make timestamp overrides optional in tests and add faketime test #1953
kounelisagis
merged 10 commits into
dev
from
agis/sc-42967/make-timestamp-overrides-optional
Apr 19, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bekadavis9
approved these changes
Apr 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
ihnorton
requested changes
Apr 18, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggested changes, but overall great work on the test_timestamp_overrides
. When I apply the changes here, copy just that file out
- run w/ pytest under tiledb-py<0.28, it fails (as expected)
- run with tiledb-py==0.28, it succeeds. Excellent!
ihnorton
approved these changes
Apr 19, 2024
kounelisagis
deleted the
agis/sc-42967/make-timestamp-overrides-optional
branch
April 19, 2024 04:30
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently in TileDB-Py we have a number of tests which override the timestamp for writes in order to avoid test failures when writes happen within the same millisecond, e.g.:
TileDB-Py/tiledb/tests/cc/test_cc.py
Line 124 in ff21497
TileDB-Py/tiledb/tests/test_fragments.py
Line 100 in ff21497
In libtiledb 2.22.0 a sub-millisecond temporal disambiguation of random labels from a single-process is implemented (serialized ordering for writes).
To test this from Python, tests that use timestamp ordering overrides are modified. They now run both with and without overriding and they should succeed in both cases. This solution is temporary; in the future, code that uses ordering override will be removed, ensuring a robust solution.
Additionally, to directly check that the new feature is working as expected, libfaketime is utilized. More specifically the faketime wrapper comes in handy in our case to decrease the complexity and have a unified solution for both Linux and macOS.
By using faketime and setting the time multiplier to zero (
faketime -f '+x0' python time_test.py
), we are able to "freeze" time for the whole duration of the test which runs in a subprocess.Installation of libfaketime means a new CI step. A new test file,
test_timestamp_overrides
is added to run write tests under faketime and check that the expected outcome holds.Checking if libfaketime exists, means a system call to skip test.