@@ -209,16 +209,7 @@ func BenchmarkAll(b *testing.B) {
209
209
}
210
210
}
211
211
212
- func TestIssue21181 (t * testing.T ) {
213
- if testing .Short () {
214
- t .Skip ("skipping with -short" )
215
- }
216
- if * flagCheck {
217
- // slow, not worth repeating in -check
218
- t .Skip ("skipping with -check set" )
219
- }
220
- testenv .MustHaveGoBuild (t )
221
-
212
+ var warmupCache = sync .OnceFunc (func () {
222
213
// Warm up the import cache in parallel.
223
214
var wg sync.WaitGroup
224
215
for _ , context := range contexts {
@@ -230,6 +221,19 @@ func TestIssue21181(t *testing.T) {
230
221
}()
231
222
}
232
223
wg .Wait ()
224
+ })
225
+
226
+ func TestIssue21181 (t * testing.T ) {
227
+ if testing .Short () {
228
+ t .Skip ("skipping with -short" )
229
+ }
230
+ if * flagCheck {
231
+ // slow, not worth repeating in -check
232
+ t .Skip ("skipping with -check set" )
233
+ }
234
+ testenv .MustHaveGoBuild (t )
235
+
236
+ warmupCache ()
233
237
234
238
for _ , context := range contexts {
235
239
w := NewWalker (context , "testdata/src/issue21181" )
@@ -243,11 +247,17 @@ func TestIssue21181(t *testing.T) {
243
247
}
244
248
245
249
func TestIssue29837 (t * testing.T ) {
250
+ if testing .Short () {
251
+ t .Skip ("skipping with -short" )
252
+ }
246
253
if * flagCheck {
247
254
// slow, not worth repeating in -check
248
255
t .Skip ("skipping with -check set" )
249
256
}
250
257
testenv .MustHaveGoBuild (t )
258
+
259
+ warmupCache ()
260
+
251
261
for _ , context := range contexts {
252
262
w := NewWalker (context , "testdata/src/issue29837" )
253
263
_ , err := w .ImportFrom ("p" , "" , 0 )
0 commit comments