wip: refactor log sink - #8587
Conversation
Closes: #8555 Signed-off-by: Jagoda 艢l膮zak <jslazak@jslazak.com>
|
This is a draft, not really sure about any of this yet.
|
| bob.assert_warn("receiving from an empty and closed channel") | ||
| .await; | ||
| // wait for logs | ||
| tokio::time::sleep(Duration::from_millis(500)).await; |
There was a problem hiding this comment.
This can likely be fixed by join() for recently seen loop task before dropping recently_seen_loop, probably need some changes there so it can be shut down cleanly as outside the tests we currently just abort it from the scheduler.
| .await; | ||
| alice.assert_warn("IMAP got rate limited").await; | ||
| // wait for logs | ||
| tokio::time::sleep(Duration::from_millis(500)).await; |
There was a problem hiding this comment.
Not sure, but maybe this case can be fixed by inserting EventType::Test and then reading events until finding it in assert_warns_or_errors, similarly to what get_matching_ext does.
| } | ||
|
|
||
| /// Returns a reference to the event tracker. | ||
| pub fn get_evtracker(&self) -> &EventTracker { |
There was a problem hiding this comment.
nit: getters normally don't have a get_ prefix in rust (https://rust-lang.github.io/api-guidelines/naming.html#getter-names-follow-rust-convention-c-getter). I think we have it in several places anyway, also because of C conventions around FFI and older code.
This can likely be solved by creating another broadcast channel receiver and reading from it. Not as simple as expected originally, but will avoid the task (the one that was spawned in |
Closes: #8555