chore: decrease timeout in tsfn test

This commit is contained in:
LongYinan 2023-03-20 11:59:53 +08:00
parent a6e1ff471c
commit d255a0a575
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -138,6 +138,7 @@ pub async fn tsfn_return_promise_timeout(func: ThreadsafeFunction<u32>) -> Resul
use tokio::time::{self, Duration}; use tokio::time::{self, Duration};
let promise = func.call_async::<Promise<u32>>(Ok(1)).await?; let promise = func.call_async::<Promise<u32>>(Ok(1)).await?;
let sleep = time::sleep(Duration::from_millis(100)); let sleep = time::sleep(Duration::from_millis(100));
let sleep = time::sleep(Duration::from_nanos(1));
tokio::select! { tokio::select! {
_ = sleep => { _ = sleep => {
return Err(Error::new(Status::GenericFailure, "Timeout".to_owned())); return Err(Error::new(Status::GenericFailure, "Timeout".to_owned()));