@@ -237,7 +237,7 @@ func TestTraceStress(t *testing.T) {
237
237
runtime .GC ()
238
238
// Trigger GC from malloc.
239
239
n := int (1e3 )
240
- if runtime . GOOS == "openbsd" && runtime . GOARCH == "arm" {
240
+ if isMemoryConstrained () {
241
241
// Reduce allocation to avoid running out of
242
242
// memory on the builder - see issue/12032.
243
243
n = 512
@@ -322,6 +322,21 @@ func TestTraceStress(t *testing.T) {
322
322
testBrokenTimestamps (t , trace )
323
323
}
324
324
325
+ // isMemoryConstrained reports whether the current machine is likely
326
+ // to be memory constrained.
327
+ // This was originally for the openbsd/arm builder (Issue 12032).
328
+ // TODO: move this to testenv? Make this look at memory? Look at GO_BUILDER_NAME?
329
+ func isMemoryConstrained () bool {
330
+ if runtime .GOOS == "plan9" {
331
+ return true
332
+ }
333
+ switch runtime .GOARCH {
334
+ case "arm" , "mips" , "mipsle" :
335
+ return true
336
+ }
337
+ return false
338
+ }
339
+
325
340
// Do a bunch of various stuff (timers, GC, network, etc) in a separate goroutine.
326
341
// And concurrently with all that start/stop trace 3 times.
327
342
func TestTraceStressStartStop (t * testing.T ) {
@@ -381,9 +396,9 @@ func TestTraceStressStartStop(t *testing.T) {
381
396
runtime .GC ()
382
397
// Trigger GC from malloc.
383
398
n := int (1e3 )
384
- if runtime . GOOS == "openbsd" && runtime . GOARCH == "arm" {
399
+ if isMemoryConstrained () {
385
400
// Reduce allocation to avoid running out of
386
- // memory on the builder - see issue/12032 .
401
+ // memory on the builder.
387
402
n = 512
388
403
}
389
404
for i := 0 ; i < n ; i ++ {
0 commit comments