You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
journal::send(&[&filter,&msg]);assert!(j.match_flush().unwrap().match_add(key, value).is_ok());let r = j.next_record().unwrap();assert!(r.is_some());
But the issue is that the next record might not immediately be available. There's a delay for the daemon to process it and then it finally making it available to open cursors. Adding:
journal::send(&[&filter, &msg]);
assert!(j.match_flush().unwrap().match_add(key, value).is_ok());
+ thread::sleep(time::Duration::from_millis(1000));
let r = j.next_record().unwrap();
as a test fixes it for me, though a cleaner course of action would probably be to expose the notification API and make use of it in the tests?
The text was updated successfully, but these errors were encountered:
Do you have a reference to which API is that?
I just double-checked in go-systemd testsuite and indeed artificial 1s pauses got inserted in all roundtrips there.
Ya, this should use the Journal::wait() method. These tests been modified a bit since this comment: they now iterate over journal entries rather than assuming it'll get the right one immediately.
In
test_simple_match()
, we have:But the issue is that the next record might not immediately be available. There's a delay for the daemon to process it and then it finally making it available to open cursors. Adding:
journal::send(&[&filter, &msg]); assert!(j.match_flush().unwrap().match_add(key, value).is_ok()); + thread::sleep(time::Duration::from_millis(1000)); let r = j.next_record().unwrap();
as a test fixes it for me, though a cleaner course of action would probably be to expose the notification API and make use of it in the tests?
The text was updated successfully, but these errors were encountered: