aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-rtmock/src/time.rs
Commit message (Collapse)AuthorAgeFilesLines
* Make test_with_all_runtimes cover _all_ the runtimes.Nick Mathewson2022-01-261-2/+2
| | | | | | | | | | | This took some refactoring, so that I wouldn't need to define 9 different versions of the function. It also required that we change the behavior of test_with_all_runtimes slightly, so that it asserts on _any_ failure rather than asserting on most but returning Err() for others. That in turn required changes to a few of its callers. There's probably a better way to do all of this macro business, but this is the best I could find.
* Replace all println/eprintln calls outside of arti CLI with trace.Nick Mathewson2021-11-041-17/+22
|
* Fix some clippy-nightly warnings.Nick Mathewson2021-10-261-6/+8
| | | | These are my fault; I merged the wrong version of !102. :p
* Overhaul the way WaitFor and the MockSleepProvider worketa2021-10-261-1/+200
| | | | | | | | | | | | | | | | | | | | | Instead of racily advancing time forward, this commit attempts to rework how WaitFor works, such that it makes advances when all sleeper futures that have been created have been polled (by handing the MockSleepRuntime a Waker with which to wake up the WaitFor). The above described mechanics work well enough for the double timeout test, but fail in the presence of code that spawns asynchronous / background tasks that must make progress before time is advanced for the test to work properly. In order to deal with these cases, a set of APIs are introduced in order to block time from being advanced until some code has run, and a carveout added in order to permit small advances in time where required. (In some cases, code needed to be hacked up a bit in order to be made properly testable using these APIs; the `MockablePlan` trait included in here is somewhat unfortunate.) This should fix arti#149.
* fix/silence clippy lints in test modulesDaniel Eades2021-09-081-9/+10
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+312
This will cause some pain for now, but now is really the best time to do this kind of thing.