summaryrefslogtreecommitdiff
path: root/crates/tor-rtmock/src/task.rs
Commit message (Collapse)AuthorAgeFilesLines
* Convert a few crates to slotmap-carefulNeel Chauhan2024-10-171-3/+3
|
* tor-rtmock: Add some commentary about SleepLocationIan Jackson2024-10-081-0/+6
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2502#note_3090557
* tor-rtmock: Fix a memory leakIan Jackson2024-10-081-6/+20
| | | | | | Change the waker to have a weak reference to the executor. Detected by miri.
* tor-rtmock: Provide a fake SleepProvider for miriIan Jackson2024-10-081-0/+16
|
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-281-1/+2
| | | | | | | | | | | | | | Having this in the `tor-async-utils` crate prevents us from doing both of the following without introducing a circular dependency: * using it in `tor-rtmock` (which we currently do, particularly in tests). * using `tor-rtmock` to test things in `tor-async-utils`. We don't do this yet, but it is generally sensible to do so. In particular we want to move the `stream_peak` module there, which is currently tested with `tor-rtmock`. Moving this into its own crate avoids this circular dependency.
* Match previous backtrace formattingRobin Leander Schröder2024-08-081-1/+1
| | | | | std::backtrace::Backtrace's Display looks the same as backtrace_rs::Backtrace's Debug
* Use std::backtrace instead of backtrace crateRobin Leander Schröder2024-08-011-33/+8
| | | | | Removes resolve_backtraces from rtmock since it is no longer needed as stdlib's backtraces automatically lazily resolve without needing a &mut.
* Suppress a spurious dead code lintIan Jackson2024-04-251-0/+1
|
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-rtmock: get rid of unwrap()Saksham Mittal2023-11-211-1/+1
|
* tor-rtmock: handle Receiver result inside spawn_join()Saksham Mittal2023-11-211-2/+2
|
* tor-rtmock: use expect() insteadSaksham Mittal2023-11-211-1/+2
|
* 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/+17
| | | | | | | 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: MockExecutor: Provide n_tasks accessorIan Jackson2023-10-161-0/+15
|
* 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-051-0/+1
| | | | I have no idea why these became necessary.
* Merge branch 'clippy' into 'main'Ian Jackson2023-08-231-0/+1
|\ | | | | | | | | 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-231-0/+1
| |
* | 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.
* 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-101-0/+1
|
* 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-061-1/+3
|
* 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: MockExecutor: Configurable scheduling policyIan Jackson2023-07-061-4/+61
|
* tor-rtmock: Unit tests for MockExecutorIan Jackson2023-07-061-0/+106
|
* tor-rtmock: Provide MockExecutorIan Jackson2023-07-061-0/+581