})
counters := readCounters(t, telemetryDir)
if _, ok := scriptGoInvoked.Load(testing.TB(t)); ok {
- if len(counters) == 0 {
+ if !disabledOnPlatform && len(counters) == 0 {
t.Fatal("go was invoked but no counters were incremented")
}
}
}
}
}
+
+// Copied from https://go.googlesource.com/telemetry/+/5f08a0cbff3f/internal/telemetry/mode.go#122
+// TODO(go.dev/issues/66205): replace this with the public API once it becomes available.
+//
+// disabledOnPlatform indicates whether telemetry is disabled
+// due to bugs in the current platform.
+const disabledOnPlatform = false ||
+ // The following platforms could potentially be supported in the future:
+ runtime.GOOS == "openbsd" || // #60614
+ runtime.GOOS == "solaris" || // #60968 #60970
+ runtime.GOOS == "android" || // #60967
+ runtime.GOOS == "illumos" || // #65544
+ // These platforms fundamentally can't be supported:
+ runtime.GOOS == "js" || // #60971
+ runtime.GOOS == "wasip1" || // #60971
+ runtime.GOOS == "plan9" // https://github.com/golang/go/issues/57540#issuecomment-1470766639