diff --git a/src-tauri/src/commands/license_commands.rs b/src-tauri/src/commands/license_commands.rs index ba35d9e..b786e6b 100644 --- a/src-tauri/src/commands/license_commands.rs +++ b/src-tauri/src/commands/license_commands.rs @@ -2624,7 +2624,9 @@ mod tests { // === One check at a time (#373) =========================================================== // // Each test has its own turn, standing for `REVOCATION_CHECK_TURN`: tests run on parallel - // threads, and a turn shared between them would decide which check goes first. + // threads, and a turn shared between them would decide which check goes first. `join!` is + // `biased`: its first branch is polled first, every time, so it is the check that starts + // first. /// A turn of its own for one test. fn new_turn() -> tauri::async_runtime::Mutex<()> { @@ -2649,6 +2651,7 @@ mod tests { let turn = new_turn(); let (first, second) = tokio::join!( + biased; check_revocation_in_turn(&turn, &dir.0, &url, &dec, || NOW), check_revocation_in_turn(&turn, &dir.0, &url, &dec, || NOW), ); @@ -2694,6 +2697,7 @@ mod tests { let turn = new_turn(); let (first, second) = tokio::join!( + biased; check_revocation_in_turn(&turn, &dir.0, &url, &dec, || NOW), async { store_license_in(&dir.0, &new_key, &dec).unwrap(); @@ -2735,6 +2739,7 @@ mod tests { let running = turn.lock().await; let (dir_ref, clock_ref, key_ref) = (&dir, &clock, &key); let (result, ()) = tokio::join!( + biased; check_revocation_in_turn(&turn, &dir.0, &url, &dec, || { clock.load(std::sync::atomic::Ordering::SeqCst) }),