Skip to content

Commit 858fc74

Browse files
authored
database: lock mock properly to avoid data race in tests (gogs#7869)
Fixes tests data race found in https://github.com/gogs/gogs/actions/runs/12457230279/job/34771555537
1 parent 83f2c86 commit 858fc74

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

internal/database/actions_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ func actionsPushTag(t *testing.T, ctx context.Context, s *ActionsStore) {
706706
// NOTE: We set a noop mock here to avoid data race with other tests that writes
707707
// to the mock server because this function holds a lock.
708708
conf.SetMockServer(t, conf.ServerOpts{})
709+
conf.SetMockSSH(t, conf.SSHOpts{})
709710

710711
alice, err := newUsersStore(s.db).Create(ctx, "alice", "[email protected]", CreateUserOptions{})
711712
require.NoError(t, err)

0 commit comments

Comments
 (0)