Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
insipx committed Jul 8, 2024
1 parent d605095 commit f908455
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-ffi-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
- name: Run cargo test on FFI bindings
run: |
export CLASSPATH="${{ env.CLASSPATH }}"
cargo test --manifest-path bindings_ffi/Cargo.toml -- --test-threads=1
RUST_LOG=warn,xmtpv3::mls=info cargo test --manifest-path bindings_ffi/Cargo.toml -- --test-threads=1
17 changes: 7 additions & 10 deletions bindings_ffi/src/mls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ mod tests {
use std::{
env,
sync::{
atomic::{AtomicBool, AtomicU32, Ordering},
atomic::{AtomicU32, Ordering},
Arc, Mutex,
},
};
Expand All @@ -1298,7 +1298,7 @@ mod tests {
self,
distributions::{Alphanumeric, DistString},
};
use tokio::time::error::Elapsed;
use tokio::{sync::Notify, time::error::Elapsed};
use xmtp_cryptography::{signature::RecoverableSignature, utils::rng};
use xmtp_id::associations::generate_inbox_id;
use xmtp_mls::{storage::EncryptionKey, InboxOwner};
Expand Down Expand Up @@ -1343,7 +1343,7 @@ mod tests {
num_messages: Arc<AtomicU32>,
messages: Arc<Mutex<Vec<FfiMessage>>>,
conversations: Arc<Mutex<Vec<Arc<FfiGroup>>>>,
is_pending: Arc<AtomicBool>,
notify: Arc<Notify>,
}

impl RustStreamCallback {
Expand All @@ -1354,10 +1354,7 @@ mod tests {
pub async fn wait_for_delivery(&self) -> Result<(), Elapsed> {
log::info!("WAITING FOR DELIVERY");
tokio::time::timeout(std::time::Duration::from_secs(60), async {
while !self.is_pending.load(Ordering::SeqCst) {
tokio::task::yield_now().await;
}
self.is_pending.store(false, Ordering::SeqCst);
self.notify.notified().await
})
.await
}
Expand All @@ -1373,7 +1370,7 @@ mod tests {
);
messages.push(message);
let _ = self.num_messages.fetch_add(1, Ordering::SeqCst);
self.is_pending.store(true, Ordering::SeqCst);
self.notify.notify_one();
}
}

Expand All @@ -1383,7 +1380,7 @@ mod tests {
let _ = self.num_messages.fetch_add(1, Ordering::SeqCst);
let mut convos = self.conversations.lock().unwrap();
convos.push(group);
self.is_pending.store(true, Ordering::SeqCst);
self.notify.notify_one();
}
}

Expand Down Expand Up @@ -1812,7 +1809,7 @@ mod tests {
alix_group.send("hello1".as_bytes().to_vec()).await.unwrap();
message_callbacks.wait_for_delivery().await.unwrap();

bo.conversations().sync().await.unwrap();
// bo.conversations().sync().await.unwrap();

let bo_groups = bo
.conversations()
Expand Down

0 comments on commit f908455

Please sign in to comment.