From b09f317aa078f09b68d5911ff38cbed0bab6e2a9 Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Sun, 22 Dec 2024 15:09:42 -0500 Subject: [PATCH] database: lock mock properly to avoid data race in tests (#7869) Fixes tests data race found in https://github.com/gogs/gogs/actions/runs/12457230279/job/34771555537 --- internal/database/actions_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/database/actions_test.go b/internal/database/actions_test.go index bd203d145..d743ae2bf 100644 --- a/internal/database/actions_test.go +++ b/internal/database/actions_test.go @@ -706,6 +706,7 @@ func actionsPushTag(t *testing.T, ctx context.Context, s *ActionsStore) { // NOTE: We set a noop mock here to avoid data race with other tests that writes // to the mock server because this function holds a lock. conf.SetMockServer(t, conf.ServerOpts{}) + conf.SetMockSSH(t, conf.SSHOpts{}) alice, err := newUsersStore(s.db).Create(ctx, "alice", "alice@example.com", CreateUserOptions{}) require.NoError(t, err)