Ian Jackson
220900a852
tor-error: tracing module: Fix link to tracing macro
2023-07-07 17:48:05 +01:00
Nick Mathewson
70f0fe634f
Merge branch 'report-bugs-v2' into 'main'
...
Optional tracing support in tor-error for error reporting
See merge request tpo/core/arti!1379
2023-07-07 13:49:59 +00:00
Nick Mathewson
023d288ba2
event_report: assert correctness of format ending
...
(Also, document that this static assertion is the reason why you are
seeing a confusing error message.)
2023-07-07 09:00:31 -04:00
Nick Mathewson
a441b4e9d3
circmgr: Use event_report!() and similar macros
...
This simplifies our logging a little, and implements part of
2023-07-07 09:00:31 -04:00
Nick Mathewson
7168feefdd
tor-error: Add optional tracing support
...
The main contribution here is a set of convenience macros for
logging error `Report`s. Notably, this macros always logs
`Internal` and `BadAspiUsage` errors at `WARN`, unless they
are already at `ERROR` or more.
This is a little tricky because `tracing::event!()` requires
its Level argument to be a constant.
2023-07-07 09:00:31 -04:00
Ian Jackson
80f397fb0b
Merge branch 'allow_missing_panics' into 'main'
...
add_warning: Tolerate clippy::missing_panics_doc
Closes #950
See merge request tpo/core/arti!1380
2023-07-07 12:53:46 +00:00
Nick Mathewson
2b3d4150e3
Merge branch 'clippy-nightly-20230703' into 'main'
...
Fix various warnings from clippy nightly
Closes #943
See merge request tpo/core/arti!1369
2023-07-07 12:26:45 +00:00
Nick Mathewson
4caf86349c
Remove explicit allows for missing_panics_docs.
...
These are no longer needed.
2023-07-06 14:36:13 -04:00
Nick Mathewson
03f9f9987a
Run add_warning to remove `missing_panics_doc` deny.
...
Closes #950 .
2023-07-06 14:32:23 -04:00
Nick Mathewson
07b4b11d7a
Avoid matches!(x, None), matches!(x, Ok(_))
...
This appeases clippy-nightly.
2023-07-06 14:26:48 -04:00
Nick Mathewson
486b6b8c82
tor-rtcompat: Simplify trivial all() expressions.
...
Clippy nightly doesn't like `#[cfg(all(...))]` with only a single
expression inside the `all(...)`.
This requires an adjustment in check_doc_features.
2023-07-06 14:26:43 -04:00
Ian Jackson
de97288c53
tor-rtmock: statically assert that the macro makes a Runtime impl
2023-07-06 15:58:42 +01:00
Ian Jackson
f0168b5220
tor-rtmock: Use the same specified field for BlockOn and Spawn
...
These are always the same and probably always will be.
2023-07-06 15:58:42 +01:00
Ian Jackson
1ec339daf4
Merge branch 'task4' into 'main'
...
Introduce a MockExecutor for fully-isolated test cases
See merge request tpo/core/arti!1375
2023-07-06 14:41:04 +00:00
Nick Mathewson
36a92e44d9
Merge branch 'log_precision' into 'main'
...
arti: Add a `logging.time_granularity` option with 1s default.
Closes #551
See merge request tpo/core/arti!1376
2023-07-06 14:37:49 +00:00
Ian Jackson
0b8b965cf7
tor-rtmock: Add semver.md
2023-07-06 15:14:41 +01:00
Ian Jackson
6ed8e0b669
tor-rtmock: task: Fix a typo
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1375#note_2919976
2023-07-06 15:14:41 +01:00
Ian Jackson
7e7428611e
tor-rtmock: task: clarify progress_until_stalled a little
2023-07-06 15:14:41 +01:00
Ian Jackson
6aff623c08
tor-rtmock: Runtime: Expand on "allowed" documentation
2023-07-06 15:14:41 +01:00
Ian Jackson
02293bd42d
tor-rtmock: task: Remove a () assignment
...
Discussion:
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1375#note_2919928
2023-07-06 15:14:41 +01:00
Ian Jackson
89994142d3
tor-rtmock: task: Abolish TaskFutureInfo alias (fmt)
2023-07-06 15:14:41 +01:00
Ian Jackson
78071c30ef
tor-rtmock: task: Abolish TaskFutureInfo alias
...
Requested by:
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1375#note_2919926
2023-07-06 15:14:41 +01:00
Ian Jackson
55329fe85b
tor-rtmock: Net: Make UDP sockets un-constructable
...
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
2023-07-06 15:14:41 +01:00
Ian Jackson
5a05960958
tor-rtmock: Add a cross-reference from MockSleepRuntime::wait_for
2023-07-06 15:14:41 +01:00
Ian Jackson
1f41281cfd
tor-dirmgr: bridge descriptor tests: Add a missing #[traced_test]
...
This seems to have been overlooked.
2023-07-06 15:14:41 +01:00
Ian Jackson
a4bb2a8b57
tor-dirmgr: bridge descriptor tests: Use MockRuntime (drop Tokio dep)
...
This isn't used any more.
2023-07-06 15:14:40 +01:00
Ian Jackson
25e51f212a
tor-dirmgr: bridge descriptor tests: Use MockRuntime (fmt)
...
Run rustfmt.
2023-07-06 15:14:40 +01:00
Ian Jackson
5eb066acf9
tor-dirmgr: bridge descriptor tests: Use MockRuntime
...
This abolishes a bodge sleep. It should make the tests deterministic.
2023-07-06 15:14:40 +01:00
Ian Jackson
473fd23f8b
tor-dirmgr: bridge descriptor tests: Fix a v. low prob. race
...
Drain a number of events, not just one. The stream might yield many
events, as explained in this new comment.
This fails every time with MockExecutor::try_test_with_various().
I think it might fail with the tokio exeuctor too, but evidently not
with high probability or we would have noticed.
2023-07-06 15:14:40 +01:00
Ian Jackson
bc63fdb34c
tor-hsclient: Abolish ad-hoc real-world-time sleeps
...
Now we can reliably wait precisely for the tasks to be all waiting.
This test case no longer involves any real executor.
2023-07-06 15:14:40 +01:00
Ian Jackson
dc28b320f4
tor-rtmock: MockRuntime: provide test_with_various
...
In both fallible and infallible variants, for convenience.
2023-07-06 15:14:40 +01:00
Ian Jackson
e23b1e00b5
tor-rtmock: MockExecutor: Configurable scheduling policy
2023-07-06 15:14:40 +01:00
Ian Jackson
be632ba0f9
tor-rtmock: Provide MockRuntime
2023-07-06 15:14:40 +01:00
Ian Jackson
67941488ab
tor-rtmock: Unit tests for MockExecutor
2023-07-06 15:14:40 +01:00
Ian Jackson
d82ed8d793
tor-rtmock: Provide MockExecutor
2023-07-06 15:14:40 +01:00
Ian Jackson
70fdd92030
tor-rtmock: impl Default for MockNetProvider
2023-07-06 15:14:40 +01:00
Ian Jackson
24da490ef5
tor-rtmock: impl Default for MockNetProvider (prep)
...
We want MockNetProvider to be Default.
In this commit: impl Default for MockNetwork and use it in new().
2023-07-06 15:14:40 +01:00
Ian Jackson
29cc83b35e
tor-rtmock: impl Default for MockSleepProvider
...
Pick an arbitrary start time roughly now. This will do for many
tests.
2023-07-06 15:14:40 +01:00
Ian Jackson
395a616c9f
tor-rtmock: net: "Provide" a UDP "implementation" which doesn't work
...
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.
2023-07-06 15:14:40 +01:00
Ian Jackson
070a934451
tor-rtmock: Introduce impl_runtime_prelude (fmt)
2023-07-06 15:14:40 +01:00
Ian Jackson
492699d522
tor-rtmock: Introduce impl_runtime_prelude
...
This deduplicates some imports, which would otherwise be about to
become triplicated.
2023-07-06 15:14:40 +01:00
Ian Jackson
97e817b330
tor-rtmock: Introduce impl_runtime! macro
...
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.
2023-07-06 15:14:40 +01:00
Nick Mathewson
5a46dfef8f
arti: comments about catch_unwind
2023-07-06 09:44:51 -04:00
Nick Mathewson
6b6b3d9e53
time_granularity: Make sure formatter can't panic
...
I was unable to assure myself that tracing_subscriber could
withstand a panicking Timer, so instead I'm trying to make sure
our own LogTimer can't panic.
2023-07-06 09:44:50 -04:00
Nick Mathewson
512064cc19
arti: Add a `logging.time_granularity` option with 1s default.
...
This lets us provide less information in our logs: in particular, it
lets us avoid logging with microsecond precision.
Closes #551 .
2023-07-06 09:44:09 -04:00
Nick Mathewson
5f896aa504
Merge branch 'tracing-panic' into 'main'
...
arti: Install a panic hook that sends messages to `tracing`
Closes #921
See merge request tpo/core/arti!1377
2023-07-06 13:09:54 +00:00
Nick Mathewson
d2b6fee3f9
arti: Note possibility for future use of other tracing panic provider
2023-07-06 08:50:53 -04:00
Nick Mathewson
01f1192b20
arti: On panic, avoid allocation even more.
...
The original version of our panic handler would allocate a string
for the panic `Location`. But if we're panicking we'd like to keep
allocations to a minimum: so instead format the `Location`
conditionally.
This also drops a useless `std::borrow::Cow`. (The possibility of a
"Don't have a `Cow`" commit message was considered and rejected.)
2023-07-06 08:45:34 -04:00
Gabriela Moldovan
258dd195e0
keymgr: Explain why the TODO regarding EncodableKey can't be addressed.
2023-07-05 22:21:47 +01:00
Nick Mathewson
afa51fd5ca
Add TODO comments about possibly migrating away from the backtrace crate.
2023-07-05 16:39:11 -04:00