Fix test_history_path_detection panic: call test_init()

test_history_path_detection calls add_pending_with_file_detection(),
which spawns a thread pool task via ThreadPool::perform(). This
requires threads::init() to have been called, otherwise
assert_is_background_thread() panics.

Add the missing test_init() call, matching other tests that use
subsystems requiring initialization.

Closes #12604
This commit is contained in:
Yakov Till
2026-04-03 03:29:33 +02:00
committed by Johannes Altmanninger
parent 68453843d4
commit 90cbfd288e

View File

@@ -1810,6 +1810,7 @@ mod tests {
use crate::env::{EnvMode, EnvSetMode, EnvStack};
use crate::fs::{LockedFile, WriteMethod};
use crate::prelude::*;
use crate::tests::prelude::test_init;
use fish_build_helper::workspace_root;
use fish_wcstringutil::{
string_prefixes_string, string_prefixes_string_case_insensitive, wcs2bytes,
@@ -2292,6 +2293,7 @@ fn test_history_merge() {
#[test]
fn test_history_path_detection() {
let _cleanup = test_init();
// Regression test for #7582.
// Temporary directory for the history files.
let hist_tmpdir = fish_tempfile::new_dir().unwrap();