Skip to content

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

Merged
merged 3 commits into from
Oct 9, 2024
Merged

Run lockstep tests with IOSim #421

merged 3 commits into from
Oct 9, 2024

Conversation

jorisdral
Copy link
Collaborator

This is a follow-up to #415. See the commit messages for more details.

Copy link
Collaborator

@mheinzel mheinzel left a 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)

Copy link
Collaborator

@dcoutts dcoutts left a 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.

Base automatically changed from jdral/blockio-sim-filelock to main October 7, 2024 12:24
…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.
@jorisdral jorisdral force-pushed the jdral/lockstep-io-sim branch from 3966443 to 174e25f Compare October 9, 2024 12:56
Copy link
Collaborator

@dcoutts dcoutts left a 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.

@dcoutts
Copy link
Collaborator

dcoutts commented Oct 9, 2024

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.
@jorisdral jorisdral force-pushed the jdral/lockstep-io-sim branch from 174e25f to df8a546 Compare October 9, 2024 18:17
@jorisdral jorisdral enabled auto-merge October 9, 2024 18:17
@jorisdral jorisdral added this pull request to the merge queue Oct 9, 2024
Merged via the queue into main with commit 6802c69 Oct 9, 2024
24 checks passed
@jorisdral jorisdral deleted the jdral/lockstep-io-sim branch October 9, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants