Let presence arrive before WELCOME in the native host test

A node registering between ours entering the registry and our WELCOME
being queued is announced to us first; the extension ignores it, and so
does the test now.
This commit is contained in:
2026-09-30 15:17:25 -07:00
parent 0bb22d833e
commit ed2a23156d
+3 -1
View File
@@ -41,7 +41,9 @@ async fn a_browser_on_the_native_host_answers_a_route() {
let desc = frame::Descriptor { role: frame::ROLE_PROVIDER, brand: "hanzo".into(), caps: vec![], attrs: vec![] };
send(&mut browser, &Frame::new(frame::HELLO, "browser/native-1", "", frame::encode_hello(&desc)));
let welcome = recv(&mut browser);
// Presence can arrive before WELCOME: another node registering between
// ours entering the registry and our WELCOME being queued.
let welcome = std::iter::repeat_with(|| recv(&mut browser)).find(|f| f.typ != frame::PEER_CONNECTED).unwrap();
assert_eq!(welcome.typ, frame::WELCOME);
let id = welcome.to.clone();
assert!(id.starts_with("browser/") && id.ends_with("/native-1"), "{id}");