Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix tests
  • Loading branch information
Krut Patel committed Dec 1, 2025
commit 4935eb54038bbf19f1766417fd1df3d6df11b5a1
11 changes: 6 additions & 5 deletions src/task/task_script_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -798,10 +798,11 @@ mod tests {
use super::*;
use confique::Partial;
use pretty_assertions::assert_eq;
use std::sync::Mutex as StdMutex;
use once_cell::sync::Lazy;
use tokio::sync::Mutex as AsyncMutex;

// Ensure tests that modify global settings do not race
static TEST_SETTINGS_LOCK: StdMutex<()> = StdMutex::new(());
static TEST_SETTINGS_LOCK: Lazy<AsyncMutex<()>> = Lazy::new(|| AsyncMutex::new(()));

#[tokio::test]
async fn test_task_parse_arg() {
Expand Down Expand Up @@ -1141,7 +1142,7 @@ mod tests {

#[tokio::test]
async fn test_task_usage_hashmap() {
let _guard = TEST_SETTINGS_LOCK.lock().unwrap();
let _guard = TEST_SETTINGS_LOCK.lock().await;

// Ensure a clean settings state
crate::config::Settings::reset(None);
Expand Down Expand Up @@ -1258,7 +1259,7 @@ mod tests {

#[tokio::test]
async fn test_task_usage_multistring() {
let _guard = TEST_SETTINGS_LOCK.lock().unwrap();
let _guard = TEST_SETTINGS_LOCK.lock().await;

// Ensure a clean settings state
crate::config::Settings::reset(None);
Expand Down Expand Up @@ -1312,7 +1313,7 @@ mod tests {

#[tokio::test]
async fn test_disable_spec_from_run_scripts_for_display() {
let _guard = TEST_SETTINGS_LOCK.lock().unwrap();
let _guard = TEST_SETTINGS_LOCK.lock().await;

// Ensure a clean settings state
crate::config::Settings::reset(None);
Expand Down