aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-rtmock/src/runtime.rs
Commit message (Collapse)AuthorAgeFilesLines
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-2/+2
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* tor-rtcompat: Remove ToplevelBlockon from RuntimeIan Jackson2025-03-041-1/+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.
* tor-rtmock: miri: disable tests that use wallclock timeIan Jackson2024-10-081-1/+3
|
* tor-rtmock docs: Add some more discussion of the simulated timeIan Jackson2024-07-301-1/+17
|
* tor-rtmock docs: We have CoarseTimeProvider nowIan Jackson2024-07-301-2/+3
| | | | Improve/replace some out-of-date notes in the docs.
* Switch to derive-deftlyIan Jackson2024-04-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Fix typosDimitris Apostolou2024-01-081-1/+1
|
* rtmock: Remove now-needless to_string calls.Nick Mathewson2023-11-301-4/+0
|
* tor-rtmock: handle Receiver result inside spawn_join()Saksham Mittal2023-11-211-1/+1
|
* tor-rtmock: change return types to be less concreteSaksham Mittal2023-11-211-1/+1
|
* tor-rtmock: change return type of spawn_join()Saksham Mittal2023-11-211-3/+3
| | | | | This makes it synchronous. The trait bounds on the return type have also been relaxed to not require Clone
* tor-rtmock: introduce spawn_join() for MockRuntime & MockExecutorSaksham Mittal2023-11-211-0/+13
| | | | | | | This helps abstract away the need to create a oneshot channel in order to get the return value out of an async function when using MockRuntime. ref: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1727#note_2965352
* tor-rtmock: MockRuntimeBuilder: new sleep_provider() setterIan Jackson2023-11-011-1/+10
|
* tor-rtmock: simplify/reorganise MockRuntimeBuilder::buildIan Jackson2023-11-011-4/+3
| | | | | Always reify a default SimpleMockTimeProvider, and then apply the starting_wallclock to it. This will make the next change fit.
* tor-rtmock: MockRuntime::test_with_various: Print what we're doingIan Jackson2023-10-161-1/+6
| | | | | | | | Without this, it can be a bit confusing since you just get the output (if any) of all the test runs, concatenated. It seems sensible to put the framing centrally. And, this would be helpful if the test fails for any reason.
* tor-rtmock: MockRuntime: in advance_*, warn to stderr about loopingIan Jackson2023-10-031-1/+21
| | | | | This helped me diagnose https://gitlab.torproject.org/tpo/core/arti/-/issues/1040
* tor-rtmock: Break out advance_innerIan Jackson2023-10-031-10/+31
| | | | We're going to want to add something to it.
* tor-rtmock: Abolish deprecated Runtime::advance()Ian Jackson2023-10-031-17/+0
| | | | | Now we're making breaking changes anyway, in or mock crate, it is a convenient time to get rid of this.
* tor-rtmock: Fix doc refs to advance_*Ian Jackson2023-10-031-2/+2
|
* tor-rtmock: Rename MockRuntime::jump_to to jump_wallclockIan Jackson2023-10-031-2/+2
| | | | | | This was named after the method from MockSleepRuntime. The name is confusing because it seems to imply it might do something to the monotonic time.
* tor-rtmock: Abolish just-introduced confusing type alias (fmt)Ian Jackson2023-10-031-1/+1
|
* tor-rtmock: Abolish just-introduced confusing type aliasIan Jackson2023-10-031-8/+8
|
* tor-rtmock: Switch MockRuntime to SimpleMockSleepProviderIan Jackson2023-10-031-12/+8
| | | | | | | | | | | | | | | | For now we do this by changing the meaning of the name `MockSleepProvider` in runtime.rs. This is a bodge to reduce noise in this diff. Consequences at call sites: * If the type is named somehow, the other type must be used. * SimpleMockTimeProvider calls it jump_wallclock rather than jump_to, which is IMO a better name. (MockRuntime will change in a moment.) * SimpleMockTimeProvider's advance() function isn't async and doesn't yield. But none of the call sites actually mind that.
* tor-rtmock: Drop some obsolete caveatsIan Jackson2023-10-031-7/+2
| | | | Nowadays there are methods for this.
* tor-rtmock: MockRuntime: Work around borrowck in Rust 1.65Ian Jackson2023-09-181-0/+2
|
* tor-rtmock: MockRuntime: Move deprecated advance to end of impl blockIan Jackson2023-09-181-17/+17
| | | | This will change the ordering in the docs.
* tor-rtmock: MockRuntime: Add tests for advance_*Ian Jackson2023-09-181-0/+177
|
* tor-rtmock: MockRuntime: Provide advance_by() etc. and deprecate .advance()Ian Jackson2023-09-181-1/+100
| | | | | | | | advance_by can be used in a more natural way, rather than having to manually advance the clock in chunks to avoid triggering only the first sleep. It can also detects some "timeout triggered precisely" edge case bugs.
* tor-rtmock: MockRuntime: Provide spawn_identified() wrapperIan Jackson2023-09-181-0/+13
| | | | We should encourage the use of this, rather than Spawn::spawn()
* tor-rtmock: Expose time_until_next_timeout on MockRuntimeIan Jackson2023-08-231-0/+25
|
* tor-rtmock: Use derive-adhoc for composite runtimesIan Jackson2023-07-071-8/+5
|
* 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: task: clarify progress_until_stalled a littleIan Jackson2023-07-061-0/+2
|
* tor-rtmock: Runtime: Expand on "allowed" documentationIan Jackson2023-07-061-3/+33
|
* tor-rtmock: MockRuntime: provide test_with_variousIan Jackson2023-07-061-0/+43
| | | | In both fallible and infallible variants, for convenience.
* tor-rtmock: MockExecutor: Configurable scheduling policyIan Jackson2023-07-061-1/+13
|
* tor-rtmock: Provide MockRuntimeIan Jackson2023-07-061-0/+129