Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
e2e: Fix race condition in test_non_fastforward_identity_doc
Adrian Duke committed 7 days ago
commit bdd991a5f1778628189cf0cafd5d7b18379fdb11
parent 802e472
1 file changed +8 -0
modified crates/radicle-node/src/tests/e2e.rs
@@ -1725,6 +1725,7 @@ fn test_non_fastforward_identity_doc() {
    let mut alice = alice.spawn();
    let mut alice_laptop = alice_laptop.spawn();
    let mut bob = bob.spawn();
+
    let bob_events = bob.handle.events();
    let mut eve = eve.spawn();

    let has_issue = |node: &NodeHandle<MockSigner>, issue: &cob::ObjectId| -> bool {
@@ -1770,6 +1771,13 @@ fn test_non_fastforward_identity_doc() {
        .unwrap();
    assert!(has_issue(&eve, &issue));

+
    bob_events
+
        .wait(
+
            |e| matches!(e, Event::RefsAnnounced { nid, .. } if *nid == eve.id).then_some(()),
+
            DEFAULT_TIMEOUT,
+
        )
+
        .unwrap();
+

    // Alice updates the identity of the document to include her laptop
    let (prev, next) = {
        let repo = alice.storage.repository(rid).unwrap();