summaryrefslogtreecommitdiff
path: root/crates/tor-rtmock/src/time.rs
Commit message (Collapse)AuthorAgeFilesLines
* oneshot: Apply deferred rustfmt churnIan Jackson2023-10-111-1/+1
| | | | cargo fmt, precisely.
* oneshot: Use veneer in tor-rtmockIan Jackson2023-10-111-1/+1
|
* tor-rtmock: MockSleepProvider docs: Move example (fmt)Ian Jackson2023-10-051-12/+12
| | | | | Adding "/// " to every line causes rustfmt to have conniptions about the trailing whitespace.
* tor-rtmock: MockSleepProvider docs: Move exampleIan Jackson2023-10-051-0/+73
| | | | | | | | | | | This example demonstrates MockSleepRuntime, which we don't want to use in new tests. It's probably worth keeping it, though, to help with comprehension of existing tests. So move it. This does rather highlight the lack of good overall example/instructions for MockRuntime.
* tor-rtmock: MockSleepProvider docs: Move deprecation discussionIan Jackson2023-10-051-32/+38
| | | | | The module-level docs here are less visible and also not where most of the other stuff was.
* tor-rtmock: MockSleepProvider docs: Compare with SimpleMockTimeProviderIan Jackson2023-10-051-0/+22
|
* tor-rtmock: Add a deprecation warning to MockSleepProviderIan Jackson2023-10-031-0/+13
|
* Add cognitive-complexity exceptions for clippy.Nick Mathewson2023-09-051-0/+1
| | | | I have no idea why these became necessary.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* tor-rtmock: impl Default for MockSleepProviderIan Jackson2023-07-061-0/+7
| | | | | Pick an arbitrary start time roughly now. This will do for many tests.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* Improve documentation around Cargo features; make Runtime require Debugeta2022-05-111-0/+8
| | | | | | | | | | | | | | - arti#445 highlighted the lack of good documentation around Arti's multiple runtime support, as well as it being difficult to determine what runtime was actually in use. - Improve the documentation to solve the first problem. - To solve the second problem, make Runtime require Debug (which is arguably a good idea anyway, since it makes them easier to embed in things), and print out the current runtime's Debug information when arti is invoked with `--version`. - (It also prints out other Cargo features, too!) fixes arti#445
* Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-301-2/+0
|
* use wallclock where possible in teststrinity-1686a2022-02-261-0/+2
|
* 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.