summaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr/src/bridgedesc
Commit message (Collapse)AuthorAgeFilesLines
* TimerangeBound: Stop using std::ops::Bound.Wesley Aptekar-Cassels2024-11-251-4/+3
| | | | Fixes: #1691
* Replace _ => panic!() elsewhereIan Jackson2024-10-151-1/+1
|
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* clippy: Replace many calls to .get(0) with .first()Ian Jackson2024-01-021-1/+1
| | | | | FTR I don't think agree with clippy on this question, but then I often don't.
* tor-rtmock: Switch MockRuntime to SimpleMockSleepProviderIan Jackson2023-10-031-7/+7
| | | | | | | | | | | | | | | | 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.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* tor-dirmgr: bridge descriptor tests: Add a missing #[traced_test]Ian Jackson2023-07-061-0/+1
| | | | This seems to have been overlooked.
* tor-dirmgr: bridge descriptor tests: Use MockRuntime (fmt)Ian Jackson2023-07-061-270/+271
| | | | Run rustfmt.
* tor-dirmgr: bridge descriptor tests: Use MockRuntimeIan Jackson2023-07-061-35/+25
| | | | This abolishes a bodge sleep. It should make the tests deterministic.
* tor-dirmgr: bridge descriptor tests: Fix a v. low prob. raceIan Jackson2023-07-061-2/+5
| | | | | | | | | | 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.
* Use bool::then_some() as appropriateNick Mathewson2023-04-111-7/+7
| | | | | | Now that we require a version of Rust that allows `b.then_some(v)`, clippy complains about our use of `b.then(|| v)`.
* Sort out some TODOs in bdtest.rsIan Jackson2023-03-211-5/+4
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* bridge desc mgr: Test dormancyIan Jackson2022-11-231-0/+42
|
* BridgeConfig: Replace all Arc<BridgeConfig> with BridgeConfigIan Jackson2022-11-221-2/+1
| | | | BridgeConfig is itself an Arc now, so these are redundant.
* Fix a bunch of "needless borrow" warnings on nightlyNick Mathewson2022-11-181-1/+1
| | | | | It looks like, despite a few false starts, they've got this warning right; there weren't any false positives.
* bridge descriptor dormancy: Accept the dormancy valueIan Jackson2022-11-111-0/+1
| | | | But right now, don't do anything with it. That will come in a future MR.
* bridge descs: Add tests for process_documentIan Jackson2022-11-081-0/+100
|
* bridge descs: Rename BridgeDescMgr from BridgeDescManagerIan Jackson2022-11-081-2/+2
| | | | | | This is more consistent with our naming elsewhere. Suggested-by: Nick Mathewson <[email protected]>
* bridge desc tests: Test caching and if-modified-sinceIan Jackson2022-11-041-2/+121
|
* bridge desc tests: Break out queues_are_empty helperIan Jackson2022-11-041-2/+6
|
* bridge desc tests: Provide a sqlite connectionIan Jackson2022-11-041-2/+5
| | | | The current test case doesn't use this.
* bridge desc: Provide a Store to the bridge desc managerIan Jackson2022-11-041-5/+10
| | | | | | | | | | | | | | | | We use the one in the dirmgr. That means that our constructor now has to take a dirmgr. And, the dirmgr must have a circmgr. This is all rather odd, TBH. Add .. to the binding of the return values from setup, as future-proofing. The tests now need to provide a Store too. Make the sqlite::new_empty function pub(crate) so we can use it. We must retain the _db_tmp_dir, since when it goes away the tmp directory is deleted and the db goes readonly.
* bridge desc tests: Apply tracing_test::traced_testIan Jackson2022-11-041-0/+2
| | | | This lets us see the log messages. They look fine, as it happens.
* bridgedesc: Prepare Mockable trait for if-modified-sinceIan Jackson2022-11-031-2/+3
|
* bridge descriptors tests: Fix flaky testIan Jackson2022-11-031-1/+11
|
* bridge descriptors tests: Test set_bridges more thoroughly (fix)Ian Jackson2022-11-031-1/+1
| | | | | | The RetryDelays are being triggered for the 2nd time here, so their timeouts can be longer. We must bump the sleep to make sure we don't have a flaky test.
* bridge descriptors tests: Test set_bridges more thoroughlyIan Jackson2022-11-031-0/+34
| | | | | | | | Prior to the previous commit, set_bridges would malfunction if there were bridges which where (i) in current (ii) in queued or running (iii) in the new bridge set. This test failed then and passes now.
* bridge descriptors tests: Add another couple of test casesIan Jackson2022-11-031-1/+31
|
* bridge descriptors tests: stream_drain_ready returns event countIan Jackson2022-11-031-1/+4
| | | | We'll use this in a moment.
* bridge descriptors tests: Break out bad_bridge helper functionIan Jackson2022-11-031-7/+7
|
* bridge descriptors: Change default max_refetchIan Jackson2022-11-031-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/820#note_2850269
* bridge descriptors: TestsIan Jackson2022-11-031-0/+254