Fix intermittent test failure

This commit is contained in:
Chris McGehee 2021-05-02 10:57:11 -07:00 committed by Naveen
parent c97b4e7b38
commit a4e8751d73

View File

@ -43,10 +43,8 @@ func Test_shouldUseDiskCache(t *testing.T) {
useDiskCache: false,
},
}
for _, tt := range tests {
tt := tt
for _, tt := range tests { //nolint:paralleltest // Since we're calling os.Setenv, we can't run these in parallel.
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
if tt.useDiskCache {
if tt.diskCachePath != "" {
e := os.Setenv(UseDiskCache, "1")
@ -86,10 +84,8 @@ func Test_shouldUseBlobCache(t *testing.T) {
useBlobCache: false,
},
}
for _, tt := range tests {
tt := tt
for _, tt := range tests { //nolint:paralleltest // Since we're calling os.Setenv, we can't run these in parallel.
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
if tt.useBlobCache {
e := os.Setenv(UseBlobCache, "1")
thelperHandleError(t, e)