aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-rtmock/src
Commit message (Collapse)AuthorAgeFilesLines
* 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: task backtraces: Expand on spurious backtracesIan Jackson2023-09-131-2/+7
| | | | There's another reason you can see multiple backtraces.
* tor-rtmock: task backtraces: Fix output re backtrace multiplicityIan Jackson2023-09-131-2/+10
| | | | | | | There may be several backtraces for an asleep task. If so, print the prefix for each one. There may be no backtraces for an asleep task. If so, print a message.
* tor-rtmock: task: Add missing doc commentIan Jackson2023-09-131-1/+3
|
* tor-rtmock: task: Add warning about backtrace salienceIan Jackson2023-09-131-2/+34
| | | | With explanation of how it works.
* tor-rtmock: task: Add backtrace dumping callsIan Jackson2023-09-131-4/+4
| | | | | | | Do a full dump, not just a normal Debug dump, when we're panicking in progress_until_stalled. Add a debug dump call to one of the tests, so we can see it working.
* tor-rtmock: task: Add API for printing dumps including backtracesIan Jackson2023-09-131-3/+77
|
* tor-rtmock: task: Capture sleep backtraces, with code to dumpIan Jackson2023-09-131-4/+75
| | | | Currently nothing actually calls the dumping code.
* tor-rtmock: task: Prepare for ActualWaker::clone taking the data lockIan Jackson2023-09-131-4/+28
|
* tor-rtmock: task: Switch to unsafe RawWaker approachIan Jackson2023-09-131-5/+83
|
* tor-rtmock: task: Add space in data for sleep backtracesIan Jackson2023-09-131-5/+8
| | | | Currently this is just ().
* tor-rtmock: task: Disable traced_test under miriIan Jackson2023-09-131-2/+4
| | | | The tests still run, just without the trace output.
* Add cognitive-complexity exceptions for clippy.Nick Mathewson2023-09-053-0/+3
| | | | I have no idea why these became necessary.
* Merge branch 'clippy' into 'main'Ian Jackson2023-08-234-0/+4
|\ | | | | | | | | clippy: Suppress needless_pass_by_value in tests See merge request tpo/core/arti!1535
| * Run maint/add_warning to add lint block everywhereIan Jackson2023-08-234-0/+4
| |
* | tor-rtmock: Relax Sync bound on spawned tasks in MockExecutorIan Jackson2023-08-231-2/+2
| | | | | | | | | | Sync is actually otiose - and I'm about to have some test cases with futures that aren't Sync.
* | tor-rtmock: Expose time_until_next_timeout on MockRuntimeIan Jackson2023-08-231-0/+25
|/
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Run cargo +nightly fmt to format many let ... else ...Ian Jackson2023-07-241-2/+6
| | | | | | | | | | | rustfmt has grown opinions about how let ... else ... ought to be formatted. They don't always agree with our previous manual decisions. I think our policy is to always insist on rustfmt. When that version of rustfmt hits stable, our CI will start to fail for everyone. (Right now this discrepancy just causes trouble for contributors who are using nightly by default.)
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-105-0/+5
|
* Add exceptions for some cases of diverging_sub_expressionNick Mathewson2023-07-101-0/+1
| | | | | | | | See here for documentation on the lint: https://rust-lang.github.io/rust-clippy/master/index.html#/diverging_sub_expression The issue here, from what I can tell, is that the lint triggers whenever you use a diverging expression as a function body within an
* Merge branch 'da-task' into 'main'gabi-2502023-07-104-72/+72
|\ | | | | | | | | RFC: tor-rtmock: Use derive-adhoc for composite runtimes See merge request tpo/core/arti!1381
| * tor-rtmock: Use derive-adhoc for composite runtimesIan Jackson2023-07-074-72/+72
| |
* | Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
|/ | | | Closes #950.
* tor-rtmock: statically assert that the macro makes a Runtime implIan Jackson2023-07-061-0/+6
|
* tor-rtmock: Use the same specified field for BlockOn and SpawnIan Jackson2023-07-064-10/+8
| | | | These are always the same and probably always will be.
* tor-rtmock: task: Fix a typoIan Jackson2023-07-061-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1375#note_2919976
* tor-rtmock: task: clarify progress_until_stalled a littleIan Jackson2023-07-062-1/+5
|
* tor-rtmock: Runtime: Expand on "allowed" documentationIan Jackson2023-07-061-3/+33
|
* tor-rtmock: task: Remove a () assignmentIan Jackson2023-07-061-1/+1
| | | | | Discussion: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1375#note_2919928
* tor-rtmock: task: Abolish TaskFutureInfo alias (fmt)Ian Jackson2023-07-061-1/+3
|
* tor-rtmock: task: Abolish TaskFutureInfo aliasIan Jackson2023-07-061-7/+6
| | | | | Requested by: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1375#note_2919926
* tor-rtmock: Net: Make UDP sockets un-constructableIan Jackson2023-07-061-14/+15
| | | | | | | | This will hopefully mean anyone trying to use this will notice that it's not implemented. Prompted by: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1375#note_2919925
* tor-rtmock: Add a cross-reference from MockSleepRuntime::wait_forIan Jackson2023-07-061-0/+4
|
* 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-062-5/+74
|
* tor-rtmock: Provide MockRuntimeIan Jackson2023-07-062-0/+131
|
* tor-rtmock: Unit tests for MockExecutorIan Jackson2023-07-061-0/+106
|
* tor-rtmock: Provide MockExecutorIan Jackson2023-07-062-0/+582
|
* tor-rtmock: impl Default for MockNetProviderIan Jackson2023-07-061-0/+6
|
* tor-rtmock: impl Default for MockNetProvider (prep)Ian Jackson2023-07-061-3/+2
| | | | | | We want MockNetProvider to be Default. In this commit: impl Default for MockNetwork and use it in new().
* tor-rtmock: impl Default for MockSleepProviderIan Jackson2023-07-061-0/+7
| | | | | Pick an arbitrary start time roughly now. This will do for many tests.
* tor-rtmock: net: "Provide" a UDP "implementation" which doesn't workIan Jackson2023-07-064-5/+46
| | | | | | | | | | 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_prelude (fmt)Ian Jackson2023-07-061-1/+3
|
* tor-rtmock: Introduce impl_runtime_preludeIan Jackson2023-07-063-17/+26
| | | | | This deduplicates some imports, which would otherwise be about to become triplicated.
* tor-rtmock: Introduce impl_runtime! macroIan Jackson2023-07-064-118/+115
| | | | | | | 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.