Skip to content

Commit

Permalink
🧪 Prevent data race with UI tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mikelorant committed Mar 6, 2024
1 parent 32f6bad commit 429e6de
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions internal/ui/ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 429e6de

Please sign in to comment.