From 429e6de8a69c530f1ae72db86e373195f2556bf6 Mon Sep 17 00:00:00 2001 From: Michael Lorant Date: Wed, 6 Mar 2024 18:20:38 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Prevent=20data=20race=20with=20U?= =?UTF-8?q?I=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The change to using a global variable containing grapheme cluster width overrides introduced a data race. Disabling parallel tests in the UI package will prevent this from being detected. While this does not solve the issue, the global variable is only set once before any rendering and all reads will be safe. --- internal/ui/ui_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/ui/ui_test.go b/internal/ui/ui_test.go index 44c621d..b847521 100644 --- a/internal/ui/ui_test.go +++ b/internal/ui/ui_test.go @@ -772,8 +772,6 @@ func TestModel(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { - t.Parallel() - c := testState() if tt.args.state != nil {