-
Notifications
You must be signed in to change notification settings - Fork 9
Run lockstep tests with IOSim
#421
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
Conversation
e8a4307
to
3966443
Compare
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.
(not a proper review yet)
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.
Looks good, but I think we should take the opportunity to make sure we've got a reasonably strong test that closing table handles frees what we expect. A minimal version of that would simply be closing all table handles at the end of a run.
Separately we also want to verify that closeSession
also cleans things up.
Currently we just test the latter but not the former.
…cked Before this change, a successfull `tryLockFile` would not contribute to the number of open file handles. Instead, it would open a read-write handle to increment/decrement a counter in the locked file, after which the handle is released again before returning a `LockFileHandle`. To check whether a file has been fully unlocked, we would have to read the contents of the locked file, which is more complicated than it has to be. Instead, we now ensure that `tryLockFile` acquires a read handle after updating the counter in the file, and this handle is only released after calling `hUnlock` on the `LockFileHandle`. As such, a file lock will contribute to the number of open file handles in a `MockFS`. Our tests can then simply read this number, and make assertions about the number.
3966443
to
174e25f
Compare
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.
Yes this looks great now.
Feel free to squash and merge. |
This has some implications for `retrieveBlobs`: we remove the `Typeable m` constraint, which is not satisfiable for `IOSim s` due to the state type `s`, which is polymorphic. It turns out we do not need that constraint anyway, because it is only the existential type variables for file handles have to be checked for type equality.
174e25f
to
df8a546
Compare
This is a follow-up to #415. See the commit messages for more details.