From a18290d16639a0ba1a0c234f2aa8850f88b58d25 Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Fri, 3 Nov 2023 22:35:33 -0400 Subject: [PATCH] fix race --- internal/db/users_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/db/users_test.go b/internal/db/users_test.go index 270cee8e0..3653c1354 100644 --- a/internal/db/users_test.go +++ b/internal/db/users_test.go @@ -440,6 +440,9 @@ func usersDeleteCustomAvatar(t *testing.T, ctx context.Context, db *users) { avatar, err := public.Files.ReadFile("img/avatar_default.png") require.NoError(t, err) + tempPictureAvatarUploadPath := filepath.Join(os.TempDir(), "orgsList-tempPictureAvatarUploadPath") + conf.SetMockPicture(t, conf.PictureOpts{AvatarUploadPath: tempPictureAvatarUploadPath}) + avatarPath := userutil.CustomAvatarPath(alice.ID) _ = os.Remove(avatarPath) defer func() { _ = os.Remove(avatarPath) }()