irmin-tezos (test_gc): Add check_async_unlinked that checks if a file has been unlinked asynchronously.#2230
Merged
adatario merged 1 commit intomirage:mainfrom Mar 30, 2023
Conversation
…le has been unlinked asynchronously. This fixes flakey test failures introduced by mirage#2221 caused by files still existing that are being unlinked asynchronously. The introduced `check_asyn_unlinked` function takes a timeout argument and checks if the file has been unlinked within the specified timeout period.
art-w
approved these changes
Mar 29, 2023
Contributor
art-w
left a comment
There was a problem hiding this comment.
Thanks! I agree, it's nice that your solution still tests the real async code... Let's see if it works, we can do something more fancy if we discover that the test is still flaky :)
metanivek
approved these changes
Mar 29, 2023
| val check_removed : t -> S.commit -> string -> unit Lwt.t | ||
| end | ||
|
|
||
| let rec check_async_unlinked ?(timeout = 3.141) file = |
Member
There was a problem hiding this comment.
😼
Suggested change
| let rec check_async_unlinked ?(timeout = 3.141) file = | |
| let rec check_async_unlinked ?(timeout = Float.pi) file = |
Contributor
Author
There was a problem hiding this comment.
:) I'll keep that for a future update.
This file contains hidden or 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
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.
This fixes flakey test failures introduced by #2221 caused by files still existing that are being unlinked asynchronously (see #2227 (comment)).
The introduced
check_asyn_unlinkedfunction takes a timeout argument and checks if the file has been unlinked within the specified timeout period.Tested locally:
I've run the tests multiple times and can not reproduce the conditions observed in the CI. Still, I believe this should fix the issue.