Commit ff7e6f0
authored
fix(tests): make replay and shard read setup deterministic (#26051)
## What type of PR is this?
- [x] BUG
- [x] Test and CI
## What this PR does / why we need it
This PR fixes two independent nondeterministic test setups without
relaxing production behavior.
### TAE checkpoint replay
TestAppendAndGC2 created its database and tables through low-level TAE
catalog APIs. Those APIs mutate the in-memory catalog but do not append
rows to mo_database, mo_tables, and mo_columns. After a forced
checkpoint truncates the DDL WAL, checkpoint replay can therefore lose
the still-live database.
The prepared-DML replay fence added by #26027 exposed this invalid setup
as ExpectedEOB. The previous version of this PR skipped missing catalog
entries, but diagnostics proved the missing IDs were the live test
database and table. That production-code relaxation was removed.
The test now uses the full DDL helpers and, after restart, opens both
relations and scans every column to verify that each still contains all
99 rows.
### Shard read compatibility test
TestReadValidatesAllRemoteShardsBeforeSending could create its table
before all three CNs reported to the shard server. In the failed Ubuntu
job, all shards were initially allocated to cn1 and balancing the second
shard took 60 seconds. The shared setup context expires after 10
seconds, so the first remote compatibility check returned context
deadline exceeded after one Adjust call instead of reaching the intended
incompatible CN.
The test now waits for every CN before creating shards, bounds every
replica wait, uses separate setup and read contexts, and asserts the
exact incompatibility error. This keeps the test fast and prevents
unrelated timeout errors from satisfying require.Error.
No production code is changed.
## Validation
- TAE focused replay test: count=20
- TAE focused replay test: race count=10
- pkg/vm/engine/tae/db/test full package
- pkg/vm/engine/tae/txn/txnimpl full package
- shard compatibility test: count=30
- shard compatibility test: race count=10
- pkg/shardservice full package
- go build ./pkg/shardservice
- go vet ./pkg/shardservice
- git diff --check1 parent 65af00d commit ff7e6f0
2 files changed
Lines changed: 40 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
215 | 224 | | |
216 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
217 | 228 | | |
218 | 229 | | |
219 | 230 | | |
| |||
253 | 264 | | |
254 | 265 | | |
255 | 266 | | |
| 267 | + | |
| 268 | + | |
256 | 269 | | |
257 | | - | |
| 270 | + | |
258 | 271 | | |
259 | 272 | | |
260 | 273 | | |
| |||
266 | 279 | | |
267 | 280 | | |
268 | 281 | | |
| 282 | + | |
269 | 283 | | |
270 | 284 | | |
271 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7077 | 7077 | | |
7078 | 7078 | | |
7079 | 7079 | | |
7080 | | - | |
7081 | | - | |
7082 | | - | |
7083 | | - | |
7084 | | - | |
7085 | | - | |
7086 | | - | |
| 7080 | + | |
| 7081 | + | |
| 7082 | + | |
| 7083 | + | |
| 7084 | + | |
| 7085 | + | |
| 7086 | + | |
7087 | 7087 | | |
7088 | 7088 | | |
7089 | 7089 | | |
| |||
7110 | 7110 | | |
7111 | 7111 | | |
7112 | 7112 | | |
| 7113 | + | |
| 7114 | + | |
| 7115 | + | |
| 7116 | + | |
| 7117 | + | |
| 7118 | + | |
| 7119 | + | |
| 7120 | + | |
| 7121 | + | |
| 7122 | + | |
| 7123 | + | |
| 7124 | + | |
| 7125 | + | |
| 7126 | + | |
| 7127 | + | |
7113 | 7128 | | |
7114 | 7129 | | |
7115 | 7130 | | |
| |||
0 commit comments