Skip to content

Commit c8db690

Browse files
committed
[FIX] loader: add threads for test test_non_matching_file_ignored
1 parent c868246 commit c8db690

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/loader/builtins/file_loaders/file_updating_loader.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ mod tests {
308308
assert_eq!(doc.data, "initial");
309309
}
310310

311-
#[tokio::test]
311+
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
312312
async fn test_non_matching_files_ignored() {
313313
let temp_dir = tempfile::tempdir().unwrap();
314314
let matching_path = temp_dir.path().join("test.txt");
@@ -325,10 +325,10 @@ mod tests {
325325
let loader = builder.build();
326326

327327
let mut receiver = loader.subscribe().await;
328-
receiver.recv().await.unwrap();
328+
assert!(receiver.recv().await.is_ok());
329329

330330
std::fs::write(&non_matching_path, "modified").unwrap();
331-
tokio::time::sleep(Duration::from_secs(1)).await;
331+
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
332332

333333
assert!(receiver.try_recv().is_err());
334334
}

0 commit comments

Comments
 (0)