aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-rtmock/src/sleep_runtime.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-151-1/+0
|
* rtcompat, rtmock: Port to web-time-compat.Nick Mathewson2026-03-261-1/+1
|
* tor-rtmock: Add since= to deprecateds (formatting)Ian Jackson2025-03-061-1/+2
|
* tor-rtmock: Add since= to deprecatedsIan Jackson2025-03-061-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2843#note_3169975
* tor-rtmock: Actually apply deprecated attr to deprecated time.rsIan Jackson2025-03-061-0/+1
|
* tor-rtcompat: Remove ToplevelBlockon from RuntimeIan Jackson2025-03-041-0/+1
| | | | | | | | Introduce ToplevelRuntime as an alias, and use it in the top-level programs. Now none of the principal protocol implementation code has access to the executor's toplevel entrypoint, and can't call it by mistake.
* Switch to derive-deftlyIan Jackson2024-04-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the combination of a number of separate commits, many of which were generated by seddery, and then rebased and squashed. Cargo.toml perl -i~ -pe 's{^derive-adhoc}{derive-deftly = "0.10"}' crates/*/Cargo.toml (not regenerated during rebase) update Cargo.lock `cargo fetch` without --locked (regenerated during rebase) seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{^use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bdefine_derive_adhoc\b}{define_derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bAdhoc\b}{Deftly}g if m{derive}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[derive_adhoc\b}{#[derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc\b}{derive_deftly_adhoc} if m{use.*deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc!}{derive_deftly_adhoc!}' (not regenerated during rebase) Manually add `#[derive_deftly_adhoc]` where needed. seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[adhoc\b}{#[deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc_template}{derive_deftly_template}' (not regenerated during rebase) Manually fix up an import Manually update some builder attrs Manually fix up tor_rtmock::time_core This was missed in my seddery, due to me rebasing the branch and not redoing the seddery.
* tor-rtmock: Add deprecation warning to MockSleepRuntimeIan Jackson2023-10-051-1/+7
|
* Add cognitive-complexity exceptions for clippy.Nick Mathewson2023-09-051-0/+1
| | | | I have no idea why these became necessary.
* tor-rtmock: Use derive-adhoc for composite runtimesIan Jackson2023-07-071-8/+4
|
* tor-rtmock: Use the same specified field for BlockOn and SpawnIan Jackson2023-07-061-2/+1
| | | | These are always the same and probably always will be.
* tor-rtmock: Add a cross-reference from MockSleepRuntime::wait_forIan Jackson2023-07-061-0/+4
|
* tor-rtmock: net: "Provide" a UDP "implementation" which doesn't workIan Jackson2023-07-061-1/+0
| | | | | | | | | | Nothing in our tree actually *uses* the UDP in tests. We want a mock UDP provider that isn't part of a real runtime, so that we can make a totally-mock runtime for properly controlled testing. It seems best to make this part of MockNetProvider rather than a separate type.
* tor-rtmock: Introduce impl_runtime_preludeIan Jackson2023-07-061-9/+4
| | | | | This deduplicates some imports, which would otherwise be about to become triplicated.
* tor-rtmock: Introduce impl_runtime! macroIan Jackson2023-07-061-62/+7
| | | | | | | This deduplicates some trait delegation. We want this now because we're about to introduce a third mock runtime, so this would become triplication otherwise.
* Improve documentation around Cargo features; make Runtime require Debugeta2022-05-111-1/+1
| | | | | | | | | | | | | | - 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-1/+0
|
* Merge branch 'no-system-time' into 'main'eta2022-03-301-0/+1
|\ | | | | | | | | | | | | Don't use SystemTime::now() Closes #306 See merge request tpo/core/arti!365
| * remove most usage of SystemTime::nowtrinity-1686a2022-02-251-0/+1
| |
* | add udp to runtimetrinity-1686a2022-03-141-1/+10
|/
* Rename `SpawnBlocking` trait to `BlockOn`.Nick Mathewson2022-01-261-2/+2
| | | | | This avoids a future confusion with the new `SpawnBlocking` trait in async_executors v0.5, and better describes what the trait provides.
* Make TlsConnector wrap TCP connections, not create its owneta2021-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | `tor-rtcompat`'s `TlsConnector` trait previously included a method to create a TLS-over-TCP connection, which implied creating a TCP stream inside that method. This commit changes that, and makes the function wrap a TCP stream, as returned from the runtime's `TcpProvider` trait implementation, instead. This means you can actually override `TcpProvider` and have it apply to *all* connections Arti makes, which is useful for issues like arti#235 and other cases where you want to have a custom TCP stream implementation. This required updating the mock TCP/TLS types in `tor-rtmock` slightly; due to the change in API, we now store whether a `LocalStream` should actually be a TLS stream inside the stream itself, and check this property on reads/writes in order to detect misuse. The fake TLS wrapper checks this property and removes it in order to "wrap" the stream, making reads and writes work again.
* add semicolons if nothing returnedDaniel Eades2021-11-251-3/+3
|
* Replace all println/eprintln calls outside of arti CLI with trace.Nick Mathewson2021-11-041-5/+6
|
* Fix some clippy-nightly warnings.Nick Mathewson2021-10-261-3/+4
| | | | These are my fault; I merged the wrong version of !102. :p
* Overhaul the way WaitFor and the MockSleepProvider worketa2021-10-261-39/+55
| | | | | | | | | | | | | | | | | | | | | 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.
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+165
This will cause some pain for now, but now is really the best time to do this kind of thing.