mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 09:31:06 +00:00
log_handler test: Ignore unknown categories
Tests run parallel in multiple threads. This makes the log_handler test flaky because it may see log messages triggered by other threads. Make the handler ignore all messages not in the category we care about.
This commit is contained in:
parent
168db3b948
commit
5149dc254d
1 changed files with 7 additions and 1 deletions
|
@ -457,7 +457,13 @@ mod tests {
|
|||
_object: Option<&glib::Object>,
|
||||
message: &DebugMessage| {
|
||||
let cat = DebugCategory::get("test-cat-log").unwrap();
|
||||
assert_eq!(category, cat);
|
||||
|
||||
if category != cat {
|
||||
// This test can run in parallel with other tests, including new_and_log above.
|
||||
// We cannot be certain we only see our own messages.
|
||||
return;
|
||||
}
|
||||
|
||||
assert_eq!(level, DebugLevel::Info);
|
||||
assert_eq!(message.get(), Some("meh"));
|
||||
let _ = sender.lock().unwrap().send(());
|
||||
|
|
Loading…
Reference in a new issue