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
changing the test test_subscribe_membership_changes from using sleep to using tokio::sync::Notify/Delivery results in test failure. The stream does not receive the group membership change message.
#[tokio::test(flavor = "current_thread")]asyncfntest_subscribe_membership_changes(){let amal = Arc::new(ClientBuilder::new_test_client(&generate_local_wallet()).await);let bola = ClientBuilder::new_test_client(&generate_local_wallet()).await;let amal_group = amal
.create_group(None,GroupMetadataOptions::default()).unwrap();let amal_ptr = amal.clone();let amal_group_ptr = amal_group.clone();let notify = Delivery::new(Some(Duration::from_secs(20)));let notify_ptr = notify.clone();let(tx, rx) = tokio::sync::mpsc::unbounded_channel();letmut stream = UnboundedReceiverStream::new(rx);
tokio::spawn(asyncmove{letmut stream = amal_group_ptr.stream(amal_ptr).await.unwrap();whileletSome(item) = stream.next().await{let _ = tx.send(item);
notify_ptr.notify_one();}});
amal_group
.add_members_by_inbox_id(&amal,vec![bola.inbox_id()]).await.unwrap();
notify
.wait_for_delivery().await.expect("Never received group membership change from stream");let first_val = stream.next().await.unwrap();assert_eq!(first_val.kind, GroupMessageKind::MembershipChange);
amal_group
.send_message("hello".as_bytes(),&amal).await.unwrap();
notify
.wait_for_delivery().await.expect("Never received second message from stream");let second_val = stream.next().await.unwrap();assert_eq!(second_val.decrypted_message_bytes, "hello".as_bytes());}
The test fails with
2024-08-12T15:05:59.909954Z ERROR xmtp_mls::subscriptions: Error processing stream entry: Generic("Group intent could not be committed")
Describe the bug
changing the test
test_subscribe_membership_changes
from usingsleep
to usingtokio::sync::Notify
/Delivery
results in test failure. The stream does not receive the group membership change message.The test fails with
before the stream times out
Log output
Expected behavior
Test works with blocking behavior of
Notify
Steps to reproduce the bug
uncomment
#[ignore]
fromtest_subscribe_membership_changes
The text was updated successfully, but these errors were encountered: