-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
refactor: Make SystemTimeTools::shift() async #5450
Conversation
Using tokio Mutex instead of |
84392ea
to
8b36603
Compare
Probably you're talking about RwLock-s. Just forgot to change it back after my experiments when it appeared that the problem can't be solved with the only Tokio's RwLock. Done now, added a comment on that also. |
And also replaced Tokio's Mutex with RwLock so that parallel critical sections using |
8b36603
to
c66cd93
Compare
The fact that OTOH, there would probably a lot of things to be taken care of, like installing nextest in the CI, running doc tests with What do you think? |
Alternative solution could be to store separate shift for each test by storing a map from tokio runtime ID (https://docs.rs/tokio/1.37.0/tokio/runtime/struct.Handle.html#method.id) to time shift. Then tests have independent time shift even if they run concurrently and there is no need to take care of "locking time" in the tests. Using Switching CI to |
We don't run |
For switching to nextest I opened #5457 |
It's a more stable interface, if `shift()` suddenly will need to wait for smth like finalisation of parallel running critical sections assuming there are no time jumps, we don't need to fix all its usages.
c66cd93
to
796d34f
Compare
Removed |
Let's close this. Can be reopened if will be really needed |
It's a more stable interface, if
shift()
suddenly will need to wait for smth like finalisation ofparallel running critical sections assuming there are no time jumps, we don't need to fix all its
usages.