From bf7ec47524a068c7fa7658f03f4dd44957f492a6 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 3 Aug 2026 01:30:13 +0900 Subject: test(json): serialize the tests sharing the tabs2.json scratch file test_preserve_indentation_after_read and test_overwrites_indentation_by_default copy to and delete the same fixture path; PHPUnit runs them serially, the parallel Rust harness let them race and flake. Co-Authored-By: Claude Fable 5 --- crates/shirabe/tests/json/json_file_test.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/shirabe/tests/json') diff --git a/crates/shirabe/tests/json/json_file_test.rs b/crates/shirabe/tests/json/json_file_test.rs index 785b4721..49ac1605 100644 --- a/crates/shirabe/tests/json/json_file_test.rs +++ b/crates/shirabe/tests/json/json_file_test.rs @@ -203,7 +203,10 @@ fn test_double_escaped_unicode() { assert_eq!(data, double_data); } +// Shares the tabs2.json scratch file with test_overwrites_indentation_by_default; PHPUnit runs +// tests serially, so the two never collide upstream. #[test] +#[serial_test::serial(tabs2_fixture)] fn test_preserve_indentation_after_read() { let src = fixture_path("tabs.json"); let dst = fixture_path("tabs2.json"); @@ -223,7 +226,9 @@ fn test_preserve_indentation_after_read() { std::fs::remove_file(&dst).unwrap(); } +// See test_preserve_indentation_after_read. #[test] +#[serial_test::serial(tabs2_fixture)] fn test_overwrites_indentation_by_default() { let src = fixture_path("tabs.json"); let dst = fixture_path("tabs2.json"); -- cgit v1.3.1