Repository navigation
test: stop the browser smoke self-test waiting out a 10 s readiness budget (nightly) - #513
Conversation
…udget (nightly) Self-test fixture 13 (alive-but-unready server) checks that a readiness timeout with a live child fails at once, with no retry. Its expected outcome is the readiness budget running out, so every run waited the full production budget: 20 nonce polls, 0.5 s apart. In 14 green CI runs the standalone smoke job spent 10.09-10.28 s on it (median 10.20 s, 16-35% of the self-test), and the same self-test also runs inside each of the five required Test jobs, so CI paid it six times per run. browser_smoke.sh now reads the budget from SMOKE_READY_POLLS (default 20, so the real check is unchanged). Anything but a positive integer is rejected before a server or browser starts. Fixture 13 alone passes SMOKE_READY_POLLS=4 (about 2 s). The code after the poll loop does not depend on the budget, and the fixture's shim logs its line about 20 ms after the spawn (60 ms at most with every CPU busy). Local results (macOS, Python 3.13): - fixture 13: 10.80 s -> 2.25 s; whole self-test 100.2 s -> 92.3 s. - The new fixture passed 50 of 50 runs, and 30 of 30 with 28 busy loops on 14 CPUs. - Mutation probes give the same verdicts for the old and new fixture: retrying a live-but-unready server fails (2 spawns), and dropping the server output from that diagnostic fails. - A new parametrized test covers the knob's validation without a browser; it fails against the old script. - Full suite: 0 outcome changes across 5546 shared tests, plus the 3 new passing cases.
caohy1988
left a comment
There was a problem hiding this comment.
VERDICT: APPROVE @ ef35d72
Blind review: PR #513 @ ef35d72 (nightly slow-test fix)
Blind review from the PR body, commits, code, and CI only. Reviewed as attempted disproof.
Rejection criteria (set before reading the diff)
- RC1 — Slowness not real on main: fixture 13 does not actually burn ~10 s of fixed waiting on base
1fdc9d7, or the self-test does not run 6x per CI run. - RC2 — Coverage weakened / failure masked: the shorter budget changes what fixture 13 catches (retry detection, spawn count, diagnostic content), or the new env var alters the production check / other fixtures when unset.
- RC3 — Evidence does not reproduce: the before/after timings, test counts, new-test behavior (pass on head, fail on base), or mutation parity cannot be reproduced.
All three criteria failed (i.e. the PR survived each disproof attempt). Details below.
RC1: slowness is real — NOT MET
ci.yml:93-105runs--self-testin the smoke job;ci.yml:71-91runspytestin 5 Test jobs, andtests/test_looker_studio_dashboard.py:1047-1051runs--self-testinside the suite. 6 runs per CI run confirmed.- Independent CI check: main run
37574830017smoke log, fixture 12 line05:08:37.49to fixture 13 line05:08:47.66= 10.17 s, inside the claimed 10.09–10.28 s band. - Poll-loop arithmetic reproduced locally: 20 iterations of
curl + sleep 0.5took 10.58 s; 4 iterations took 2.08 s. - Isolated fixture-13 harness (same shim text, same assertions): budget 20 = 10.78 s; budget 4 = 2.27–2.68 s. Same ~8 s saving per run.
RC2: no coverage loss — NOT MET
- Diff is 2 files, +35/−2. Production loop
browser_smoke.sh:654changesseq 1 20toseq 1 "$READY_POLLS"with default 20 (:81), behaviorally identical when the var is unset. Only fixture 13 passesSMOKE_READY_POLLS=4(:511); the other 12 fixtures, port retry, and Chrome deadline/grace loops are untouched. - Fixture 13's three assertions are byte-identical before/after: inner must fail (
:512-514), exactly one spawn (:515-517), diagnostic carries server output (:518-519). - Mutation probe replicated with budget 4: M0 unmutated passes (2.4–2.9 s, 1 spawn, diagnostic present); M1 (alive-unready retried) yields 2 spawns, caught by the spawn assertion; M2 (diagnostic drops server output) yields 1 spawn but fails the grep assertion. Verdicts match the PR's table.
- Validation (
:81-86) rejects0, -1, abc, 00, 01, 04, " 4", "4 ", "+4", "4.0", exits 1 in ~0.016 s before any server/browser start, and theEXITtrap still cleans the temp dir. Accepts4,20. - Blast radius: only 3 tests invoke the script (lines 1024, 1048, 1060); no workflow sets
SMOKE_READY_POLLSglobally.
RC3: evidence reproduces — NOT MET
- PR run
37611576268smoke log: fixture 1211:04:46.32to fixture 1311:04:48.42= 2.10 s (claimed 2.10 s). All checks green, including all 6 self-test runs. - Test counts from CI logs: main
37574830017= 5465 passed / 81 skipped in all 5 jobs; PR run = 5468 passed / 81 skipped in all 5 jobs (+3 new cases). Exact match. pytest tests/test_looker_studio_dashboard.py -k invalid_readiness_budget→ 3 passed in 0.23 s. Old script contains 0 occurrences ofSMOKE_READY_POLLS, so the new test fails on base as claimed.- Isolated fixture 13 with budget 4: 6/6 pass, assertions hold every run.
shellcheckclean,bash -nclean (also under/bin/bash3.2.57),pyink --checkandisort --check-onlyclean on the touched test file.- Limitation: full local self-test and full-suite reruns were blocked by this sandbox (localhost bind denied, unsandboxed run unavailable), so CI logs served as the independent oracle, plus the isolated fixture harness above.
Findings
- P3:
SMOKE_READY_POLLS=""(empty) silently defaults to 20 via:-rather than being rejected, so "anything but a positive integer is rejected" is slightly overbroad. Empty-as-unset is standard and harmless; optionally soften the sentence.browser_smoke.sh:81. - P3: Leading-zero values (
04,01) are rejected though numerically positive. Over-strict but safe (clear message, retry with4). No change needed.browser_smoke.sh:82-86. - P3: An outer
SMOKE_READY_POLLSexport would leak into fixtures 1–12 (only 13 overrides). Nothing in CI sets it (verified), the var is new and header-documented, and realhttp.serverreadies in ~1 poll, so this is hardening-only: consider having the self-test pin or unset it for the other fixtures. - P0–P2: none.
What I tried (disproof log)
- Verified 6 self-test runs per CI from
ci.yml+ test file; timed fixture 13 on main (10.17 s) and PR (2.10 s) CI logs. - Ran poll-loop timing (10.58 s vs 2.08 s) and an isolated fixture-13 harness (10.78 s vs 2.27–2.68 s, 6/6 pass).
- Probed validation with 13 values incl. edge cases; confirmed fail-fast timing and exit codes.
- Replicated M1/M2 mutations against budget 4; both caught as the PR claims.
- Confirmed new test passes on head, fails on base; ran dashboard file minus network gates (30 passed); checked shellcheck, bash-3.2 syntax, pyink, isort.
- Grepped for other callers of the script and setters of the var; confirmed workflows unchanged and tree clean.
VERDICT: APPROVE @ ef35d72
caohy1988
left a comment
There was a problem hiding this comment.
VERDICT: APPROVE @ ef35d72
Independent blind review of this head against main/base 1fdc9d7e20eb1a6cca9b105977af3f1953748cb5. I read the PR body, commit, code and CI, without consulting other reviews or the context vault. No P0, P1, P2 or P3 findings. None of the following rejection criteria was met.
Before reading the diff, I recorded these criteria in rejection-criteria.md:
- Reject if the reported flake or pathological duration cannot be reproduced on the relevant main/base code under a credible matching setup, or the stated cause conflicts with observed behavior.
- Reject if the change masks a real failure, reduces meaningful coverage, alters production behavior unsafely, or introduces a missing case that lets incorrect behavior pass.
- Reject if controlled main/base-versus-head runs do not reproduce the claimed stability/duration improvement, or adversarial reruns expose a regression within the claimed scope.
The body explicitly claims a fixed-wait reduction and makes no flake-rate claim. The code matches that scope: dashboard/looker_studio/tools/browser_smoke.sh:81–86 retains the default of 20 polls and validates the override; only fixture 13 supplies 4 at line 511. Its failure, single-spawn and captured-output assertions remain at lines 512–519. The nonce check, retry classification and cleanup after the poll loop are unchanged (:654–675). No workflow or SDK behavior changes with the variable unset.
I independently reran the following:
| Attempt | Main/base | Reviewed head |
|---|---|---|
Full suite: python -m pytest --tb=short -q --durations=20 --junitxml=<version>.xml |
5,463 passed, 83 skipped | 5,466 passed, 83 skipped |
| Self-test duration within that full suite | 100.468 s | 91.397 s |
| Real configurator browser test within that full suite | 11.781 s | 11.807 s |
Complete standalone bash tools/browser_smoke.sh --self-test, two runs each |
2/2 passed; 133.64 s, 132.63 s | 2/2 passed; 124.93 s, 124.22 s |
| Fixture 13 within those standalone runs, timestamped from fixture 12's completion | 11.18 s, 10.97 s | 2.43 s, 2.51 s |
| Exact fixture 13 and shim extracted from each version, five alternating runs each | 5/5 passed; 11.057–11.190 s | 5/5 passed; 2.483–2.554 s |
| Fixture 13 with 16 CPU-busy workers on 14 logical CPUs | — | 10/10 passed; 2.686–2.822 s |
| Artificially delay the shim's diagnostic by 0.25, 1.0 and 1.5 seconds | — | 3/3 passed at each delay |
JUnit comparison found zero outcome differences across all 5,546 shared tests, no removed tests, and exactly the three new passing validation cases. Full suites used the same fresh macOS arm64 Python 3.13.7 environment. Standalone/probe pairs used the same host Bash 3.2 and Python 3.13.5 environment. Some local validation overlapped; aggregate durations include host noise. Fixture-level timing independently shows the fixed-wait reduction.
I also checked the published CI evidence directly. Fixture 13 took 10.204 s, 10.238 s and 10.170 s in main runs 37503684586, 37531231391 and 37574830017, versus 2.095 s in head run 37611576268. The head's five Python CI jobs all passed with 5,468 passed / 81 skipped, three more passing cases than the sampled base run.
To try to break coverage, I ran the exact old and new fixture assertions against separate copies with these mutations:
| Injected fault in the main check | Old fixture | New fixture | Observed rejection output |
|---|---|---|---|
| Retry a live-but-unready child | Rejected | Rejected | must fail immediately with no retry (server spawns: 2) |
| Drop the captured server output from the live-child diagnostic | Rejected | Rejected | the diagnostic must include the captured server output |
| Return success for the live-but-unready child | Rejected | Rejected | an alive-but-unready server passed |
| Skip all readiness polls | Rejected | Rejected | must fail immediately with no retry (server spawns: 0) |
Additional missing-case probes covered unset/empty budgets and explicit 1, 4, 20: unset and empty retain the approximately 10-second default; explicit values scale the wait. Startup spies confirmed that 0, -1, abc, 1.5, whitespace, +1, 01, 00, an embedded newline and 0x10 all fail with the dedicated diagnostic before Python or a browser starts. pytest tests/test_looker_studio_dashboard.py -k invalid_readiness_budget -q --durations=10 passed all three new cases; invoking those same test functions against main's script failed all three at the diagnostic assertion (tests/test_looker_studio_dashboard.py:1068, with CHROME_BIN=/bin/false to keep the negative control fast).
Reproduction artifacts are in /Users/haiyuancao/Documents/bqaa-513-review/: run_suites.py, run_smoke.py, probe_fixture.py, probe_validation.py, per-run logs/JSON, both JUnit XML files and suite-comparison.json. The probe commands were:
python3 probe_fixture.py --mode repeat --count 5
python3 probe_fixture.py --mode mutations
python3 probe_fixture.py --mode budgets
python3 probe_fixture.py --mode delays --count 3
python3 probe_fixture.py --mode stress --count 10
python3 probe_validation.py/bin/bash -n, shellcheck, and git diff --check also passed. The reviewed worktree remains unchanged. These are bounded reproductions, not a statistical flake-rate guarantee; I sampled three of the historical CI runs rather than repeating the full 14-run census or the author's 50/30-run history. No code was pushed.
VERDICT: APPROVE @ ef35d72
…umns (#514) * chore(release): 0.6.0 — span OTel correlation, ViewManager denied_columns Bump [project].version from 0.5.4 to 0.6.0 and cut CHANGELOG.md for the 10 PRs merged since v0.5.4 (#502, #504–#510, #512, #513). [Unreleased] becomes [0.6.0] - 2026-10-08 with a release-highlights lead, and a new empty [Unreleased] sits above it. The #510 entries already under [Unreleased] are kept and checked against the code: denied_columns is keyword-only and exact-case, a bare string raises TypeError, the six per-event views it skips are named, the CLI exits 2 on an invalid name, and the event-specific view columns move two positions later. The SDK.md correlation guide moves to Documentation. Every other PR in the range gets an entry marked as in the wheel or repo side; the Removed entry lists the incidental module attributes #504 dropped. 0.6.0 rather than 0.5.5: besides new public API, per-event views now select two more columns ahead of the event-specific ones, and over an events table without an attributes column they deploy only with denied_columns=["attributes"]. No code, dependency or workflow change. * docs(changelog): scope the non-string ID guarantee to the attributes fallback The [0.6.0] Span entry said the three correlation IDs stay None on rows "with non-string values". Span.from_bigquery_row() applies that check only to values it reads from attributes: a truthy same-named column value is returned unchanged ({"otel_span_id": 123} gives 123), while a non-string value in attributes is ignored and gives None. Say that the attributes fallback ignores non-string values, and that the fields stay None on rows without those columns or keys. CHANGELOG wording only; the version stays 0.6.0.
Problem
dashboard/looker_studio/tools/browser_smoke.sh --self-testruns 13 fixtures. Fixture 13 (alive-but-unready server) proves that a readiness timeout with a live child fails at once, with no retry. Its expected outcome is the readiness budget running out, so every run waited the full production budget: 20 nonce polls, 0.5 s apart, about 10 s of sleeping.The self-test runs 6 times per CI run: once in the
Configurator browser smokejob, and once inside each of the five requiredTest (Python 3.10–3.14)jobs throughtest_browser_smoke_negative_fixtures_are_detected(#497 put it there on purpose). #497 listed the slowness of these browser gates as out of scope for a follow-up. This PR is that follow-up for the one part that is pure waiting.Evidence
Configurator browser smokejob logs of the 14 most recent successfulCIruns (2026-10-06/07); each fixture prints a timestampedself-test N OKline. Fixture 13 took 10.09–10.28 s in all 14 (median 10.20 s), which is 16–35% of the whole self-test (median 36.3 s).main@1fdc9d7): fixture 13 took 10.80 s of a 100.2 s self-test.Fix (2 files, +35/−2)
browser_smoke.shreads the readiness budget fromSMOKE_READY_POLLS. The default stays 20, so the real check and the other 12 fixtures are unchanged. Anything but a positive integer is rejected before a server or browser starts, with its own message rather than a misleading readiness timeout.SMOKE_READY_POLLS=4(about 2 s). The code after the poll loop is the same for any budget. The fixture's shim logs its line about 20 ms after the spawn (median of 30; max 24 ms), and 42 ms median / 60 ms max with 28 busy loops on 14 CPUs, so 2 s leaves more than 30× headroom.tests/test_looker_studio_dashboard.pygains one parametrized test (0,-1,abc) for that validation. It needs no browser, and it fails against the old script (which ignores the variable and runs the whole check).Before / after
main@1fdc9d7)ef35d72)test_browser_smoke_negative_fixtures_are_detectedin a full-suite runConfigurator browser smokejob-qprogress line holding both browser gates, perTestjobmainruns 37503684586, 37531231391, 37574830017)Testjobs)Mutation probe. A harness runs fixture 13's exact text, copied from each script version, against a mutated copy of that version's main check:
The verdicts match, so the shorter budget doesn't change what the fixture catches.
Verification commands
Audit scope (nightly CI flake/slow pass, 2026-10-07)
This does not revisit #497 (port retry) or #505 (offline deploy-script test).
main"HOMEpointed at an empty temp dir, Chrome writes nothing andtest_configurator_loads_in_a_real_browserfails after 56 s with a bare exit status 1 (see the next row). The gate runs whenever a Chrome binary exists by design, and skipping a present-but-broken Chrome would hide real failures.browser_smoke.shexits 1 with no message when Chrome writes no DOMMARKER_TAG="$(printf … | grep -o … | head -1)"fails underset -e+pipefailbefore the "instrumentation marker missing" line can run; reproduced withCHROME_BIN=/usr/bin/trueonmainand on this branchaction_requiredand attempt 2 green after approval;Producers CIhash-lock drift ×3 on the #509 branch (new upstream releases, e.g. google-cloud-pubsub 2.42.0, proto-plus 1.29.0);External access attestation staleness(schedule): attestation overdue, so it bumps #498 and exits 1 by designmainruns)test_telemetry,test_terraform_property_graph_mode,test_trace_filter_factoryand skipped live tests. Locally the same 72 tests take 0.164 s with ADC hidden andCI=true. An audit-hook probe saw no network access there and one subprocess,terraform fmt, which doesn't wait for Terraform's checkpoint call even through a hanging proxy (0.24 s with Terraform 1.15.4 locally; the runner image has 1.16.4).terraformstart; needs per-test CI timing before any changeTestCompileExtractorline (20–41 s in CI)test_self_evolving_agent_demo.py::test_require_complete_session_metrics_rejects_zero_token_schemaload_config()makes google-auth probe 169.254.169.254 three times (8.9 s on a Mac); its CI line takes 0.4–0.5 s