Skip to content

Commit e121da6

Browse files
committed
fixup! test(event-cache-store): make time-based integration tests compatible with wasm targets
Signed-off-by: Michael Goldenberg <[email protected]>
1 parent d08a99b commit e121da6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

crates/matrix-sdk-base/src/event_cache/store/integration_tests.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,18 +1435,15 @@ macro_rules! event_cache_store_integration_tests_time {
14351435
mod event_cache_store_integration_tests_time {
14361436
use std::time::Duration;
14371437

1438+
#[cfg(all(target_family = "wasm", target_os = "unknown"))]
1439+
use gloo_timers::future::sleep;
14381440
use matrix_sdk_test::async_test;
1441+
#[cfg(not(all(target_family = "wasm", target_os = "unknown")))]
1442+
use tokio::time::sleep;
14391443
use $crate::event_cache::store::IntoEventCacheStore;
14401444

14411445
use super::get_event_cache_store;
14421446

1443-
pub async fn sleep(duration: Duration) {
1444-
#[cfg(all(target_family = "wasm", target_os = "unknown"))]
1445-
gloo_timers::future::sleep(duration).await;
1446-
#[cfg(not(all(target_family = "wasm", target_os = "unknown")))]
1447-
tokio::time::sleep(duration).await;
1448-
}
1449-
14501447
#[async_test]
14511448
async fn test_lease_locks() {
14521449
let store = get_event_cache_store().await.unwrap().into_event_cache_store();

0 commit comments

Comments
 (0)