You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[None][test] CBTS coverage: enable for all stages, kill-switch via two knobs
Swap the dogfood allowlist for an enable-by-default gate so the author
can pick stages via /bot run --stage-list rather than maintaining a
hard-coded list of stage names that drifts as stages get renamed.
L0_Test.groovy:
* Replace CBTS_DOGFOOD_STAGES = {"DGX_H100-PyTorch-1"} with two knobs:
ENABLE_CBTS_COVERAGE default true global kill-switch
CBTS_EXCLUDE_STAGES default {} per-stage opt-out
isCbtsStage() now returns true for every stage unless one of these
knobs takes effect.
coverage_utils/README.md:
* Rename the "L0 dogfood" section to "L0 rollout" and document both
kill-switches and the recommended /bot run --stage-list workflow.
* Update the validation checklist to match: A. now points at the new
kill-switches instead of the removed allowlist; D. explains the
non-CBTS-stage check in terms of an explicit opt-out rather than
a default-disabled stage.
No behavior change for stages that were already covered; legacy-
pytest-cov stages now exist only when explicitly opted out.
Signed-off-by: Ivy Zhang <25222398+crazydemo@users.noreply.github.com>
|`Submit Test Result` stage |`CBTS coverage uploaded to <UPLOAD_PATH>/cbts-coverage/cbts-<stage>.tar.gz`|
93
+
94
+
### B. Verify the uploaded artifact
95
+
96
+
```bash
97
+
tar tzf cbts-DGX_H100-PyTorch-1.tar.gz | head -20
98
+
```
99
+
100
+
Expect a `cbts/` directory with:
101
+
102
+
- one or more `.coverage.DGX_H100-PyTorch-1.<host>.pid<N>.X<rand>` per-process files
103
+
- a `cbts_seen_tests/` directory containing one sentinel file per test (filename = `sha1(nodeid)`)
104
+
105
+
### C. Validate the data is queryable
106
+
107
+
```bash
108
+
cd cbts/
109
+
# Combine all per-process files into one DB.
110
+
coverage combine --keep --rcfile=/dev/stdin <<EOF
111
+
[run]
112
+
data_file = .coverage.DGX_H100-PyTorch-1
113
+
EOF
114
+
115
+
# Count distinct test contexts (should be close to the pytest PASSED count).
116
+
python3 -c "
117
+
import sqlite3
118
+
c = sqlite3.connect('.coverage.DGX_H100-PyTorch-1')
119
+
n = c.execute('select count(*) from context where context != \"\"').fetchone()[0]
120
+
print(f'distinct test contexts: {n}')
121
+
"
122
+
123
+
# Run the audit; expect OK + MAIN_ONLY + EMPTY totals to match the test count.
124
+
python3 ../coverage_audit.py \
125
+
--db .coverage.DGX_H100-PyTorch-1 \
126
+
--sentinel-dir cbts_seen_tests \
127
+
--out-csv audit.csv --out-json audit.json
128
+
```
129
+
130
+
### D. Regression check on a non-CBTS stage
131
+
132
+
If you flipped `ENABLE_CBTS_COVERAGE = false` or added a stage to
133
+
`CBTS_EXCLUDE_STAGES`, confirm that excluded stage:
134
+
135
+
| Check | Expect |
136
+
|---|---|
137
+
| Its `.coveragerc` content | still `branch = True` (the legacy block) |
138
+
| Its pytest command line | still has `--cov=*` and `--cov-config=*`|
139
+
| Wall-clock vs historical runs | no significant change |
140
+
| No `CBTS_*` env vars in env-dump | side-effect-free |
141
+
142
+
### E. Wall-clock overhead
143
+
144
+
Compare the stage's wall time to the last few historical runs on the
145
+
same stage. Expected overhead is **+5-10%** (sysmon core is ~3-4%
146
+
per coverage.py docs; the extra is sitecustomize startup + periodic-
147
+
save in each subprocess).
148
+
149
+
> If overhead is >30%, `core = sysmon` likely did not take effect.
150
+
> Check that `branch = False` in the materialised `.coveragerc` and
151
+
> that no upstream `[run]` block overrides `core`.
152
+
153
+
### Common failure modes
154
+
155
+
| Symptom | Likely cause |
156
+
|---|---|
157
+
| None of the A. markers show up |`ENABLE_CBTS_COVERAGE` is false, or the stage is in `CBTS_EXCLUDE_STAGES`|
158
+
|`ModuleNotFoundError: No module named 'cbts_plugin'`|`PYTHONPATH` not propagated to the pytest invocation -- check the env-dump line in the log |
159
+
| Zero `.coverage.*` files scp'd back |`covScp`/`sentScp` status non-zero in the log: remote glob did not match, usually means pytest crashed before producing any per-process file |
160
+
|`audit.json` reports `FATAL: 0 named contexts`|`sitecustomize.py` did not fire in any subprocess -- usually means `PYTHONPATH` was stripped between pytest main and the subprocess (check the env whitelist in `mpi_session._start_mpi_pool`) |
161
+
| Wall-clock doubled |`branch = True` somehow leaked in, falling back to settrace |
162
+
59
163
## Key design decisions (defended in `LAYER_C_PLAN.md`)
60
164
61
165
-**No product code change.** Env propagation to MPI workers is handled
0 commit comments