diff --git a/radiomenu_test.go b/radiomenu_test.go index 9ae5afb..c05fe24 100644 --- a/radiomenu_test.go +++ b/radiomenu_test.go @@ -78,7 +78,10 @@ func TestQuit_Unit(t *testing.T) { } func TestRadioMenu_Unit(t *testing.T) { - t.Parallel() + // Do not mark Parallel: RadioMenu does fmt.Println and constructs a wmenu.Menu. + // When this runs concurrently (via t.Parallel on the parent) with + // TestShowVersion_Unit (which mutates globals and does os.Stdout swapping), + // the race detector flags concurrent fmt + wmenu activity against global writes. t.Log("✓ Fast RadioMenu unit test") tests := []struct { diff --git a/stations_test.go b/stations_test.go index 4c33ed2..a3e4e0f 100644 --- a/stations_test.go +++ b/stations_test.go @@ -15,7 +15,10 @@ import ( ) func TestShowVersion_Unit(t *testing.T) { - t.Parallel() + // Do not mark Parallel: this test mutates the package-level "version" shim + // (and internal/version vars) and redirects os.Stdout. Running it concurrently + // with other legacy tests (esp. those calling RadioMenu which does fmt + wmenu) + // produces data races under -race. t.Log("✓ Fast showVersion unit test") tests := []struct { @@ -81,7 +84,9 @@ func TestShowVersion_Unit(t *testing.T) { } func TestPrecheck_Unit(t *testing.T) { - t.Parallel() + // Do not mark Parallel: precheck reads config + calls external IsInstalled, + // and in some paths can have side effects. Keep it serialized with other + // main-package legacy tests to avoid races on shared state under -race. t.Log("✓ Fast precheck unit test") p := "mpv"