-
Notifications
You must be signed in to change notification settings - Fork 43
Stateful test for parallel sessions #1018
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
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| # @precondition(lambda self: self.has_forks()) | ||
| # @rule(commit_fork1_first=st.booleans()) | ||
| # def commit_on_forks(self, commit_fork1_first: bool): |
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.
This seems hard. I think we might need a different test that exercises rebase
| self.fork1 = None | ||
| self.fork2 = None | ||
|
|
||
| @precondition(lambda self: not self.has_forks() and self.has_changes) |
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.
this is basically saying we expect the user to fork, merge, and then commit the "base" parallel session
|
|
||
| @precondition(lambda self: bool(self.all_arrays)) | ||
| @rule(data=st.data()) | ||
| def write_chunk(self, data: st.DataObject) -> None: |
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.
This is problematic. We could draw the same path on two draws which would model the case where parallel writers write to the same chunk and behaviour is undefined. I guess I can filter on chunk paths not in self.serial.status().updated_chunks[array]
| self.parallel.commit("foo") | ||
|
|
||
| self.serial = self.repo.writable_session("main") | ||
| self.parallel = self.repo.writable_session("parallel") |
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.
I should verify_all_arrays here because we expect the state on main and parallel to be identical after committing.
Looks like it's catching a version of that bug.