Commit dcea072
committed
executor: skip analyze flush broadcast in test binaries
`make bench-daily` (CI job `gobench4`) fails on
`BenchmarkNonPartitionPointGetPlanCacheOn`: `analyze table t` hits
`context deadline exceeded` after 10s. PR #67939 added
`flushStatsDeltaForAnalyze`, which broadcasts FLUSH STATS_DELTA CLUSTER
via a TiDB-type cop request before each ANALYZE. The local-dump
fallback was gated on `intest.InTest`, but that variable is only set
under the `intest` build tag. `make bench-daily` runs `go test`
without the tag, so the broadcast hits the mockstore session's empty
`:10080` and hangs.
Replace the gate with a `runningUnderGoTest` helper backed by
`testing.Testing()`, which the linker sets to true for any binary
produced by `go test` (covering both unit tests and bench-daily) and
leaves false for `go build` of cmd/tidb-server. The gate is therefore
a no-op in production regardless of TOML host configuration, and no
longer depends on the `intest` build tag.
Issue Number: close #684161 parent f4369ec commit dcea072
1 file changed
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
92 | 104 | | |
93 | 105 | | |
94 | 106 | | |
| |||
101 | 113 | | |
102 | 114 | | |
103 | 115 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 116 | + | |
110 | 117 | | |
111 | 118 | | |
112 | 119 | | |
| |||
0 commit comments