make sure the tests run in serial and the waku_destroy is called

This commit is contained in:
Ivan Folgueira Bande 2024-12-20 18:05:55 +01:00
parent e937e0541c
commit 666bc73c04
No known key found for this signature in database
GPG Key ID: 3C117481F89E24A7
2 changed files with 9 additions and 1 deletions

View File

@ -163,9 +163,13 @@ pub async fn waku_listen_addresses(ctx: &WakuNodeContext) -> Result<Vec<Multiadd
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use super::waku_new; use super::waku_new;
use crate::node::management::{waku_listen_addresses, waku_start, waku_stop, waku_version}; use crate::node::management::{
waku_destroy, waku_listen_addresses, waku_start, waku_stop, waku_version,
};
use serial_test::serial;
#[tokio::test] #[tokio::test]
#[serial]
async fn waku_flow() { async fn waku_flow() {
let node = waku_new(None).await.unwrap(); let node = waku_new(None).await.unwrap();
@ -177,9 +181,11 @@ mod test {
assert!(!addresses.is_empty()); assert!(!addresses.is_empty());
waku_stop(&node).await.unwrap(); waku_stop(&node).await.unwrap();
waku_destroy(&node).await.unwrap();
} }
#[tokio::test] #[tokio::test]
#[serial]
async fn nwaku_version() { async fn nwaku_version() {
let node = waku_new(None).await.unwrap(); let node = waku_new(None).await.unwrap();
@ -190,5 +196,6 @@ mod test {
print!("Current version: {}", version); print!("Current version: {}", version);
assert!(!version.is_empty()); assert!(!version.is_empty());
waku_destroy(&node).await.unwrap();
} }
} }

View File

@ -170,6 +170,7 @@ async fn default_echo() -> Result<(), String> {
} }
#[tokio::test] #[tokio::test]
#[serial]
async fn node_restart() { async fn node_restart() {
let config = WakuNodeConfig { let config = WakuNodeConfig {
node_key: Some( node_key: Some(