Skip to content

test(telemetry): tz region test no longer depends on the runner's zone database - #1215

Merged
ffroliva merged 1 commit into
developfrom
test/telemetry-tz-legacy-aliases
Nov 10, 2026
Merged

ffroliva merged 1 commit into
developfrom
test/telemetry-tz-legacy-aliases

Conversation

@ffroliva

Copy link
Copy Markdown
Owner

Why

tests/test_telemetry_notice.py::test_consent_region_from_iana_timezone[Atlantic/Faeroe-False] fails on every CI run since tonight's runner image, develop included: it failed on a re-run of #1207, a docs-only PR with develop's code, and on #1208, #1210 and #1214.

Root cause (reproduced)

Ubuntu 24.04 ships tzdata 2026e with the backward-compatibility links moved into tzdata-legacy, which the runners don't install. Measured in an Ubuntu 24.04.2 WSL with that tzdata and no tzdata-legacy:

Atlantic/Faeroe ZoneInfoNotFoundError
Atlantic/Faroe  ok
Portugal / Eire / Iceland / Poland  ZoneInfoNotFoundError

_env_timezone_name only trusts TZ when ZoneInfo loads it. Otherwise consent_region() fails closed (True), so the Atlantic/Faeroe row (expected False) goes red. The Portugal/Eire/Iceland rows (expected True) passed for the wrong reason.

The product behaviour is right: an alias the system cannot load asks for consent instead of guessing. The test was wrong, because it measured the machine's zone database instead of the mapping.

Change (test-only)

  • The mapping test stubs the zone lookup, so every row checks the name-to-region mapping on any machine.
  • New test_tz_name_the_zone_database_cannot_load_fails_closed pins the fail-closed behaviour.
  • Red first: simulating the legacy-less zone database locally reproduced CI's exact failure (1 failed, 20 passed) before the fix.

Gates

The six scripts/ci checks ✅ · ruff ✅ · ruff format ✅ · pyright ✅ · pytest (offline, -n 8 --dist worksteal, coverage): 6060 passed, 30 skipped, 93%.

E2E

Test-only, so no Flow surface is touched.

Unblocks CI on the #1191 milestone PRs.

…ne database

Ubuntu 24.04's tzdata 2026e moves backward links (Atlantic/Faeroe, Portugal,
Eire, Iceland, Poland) into tzdata-legacy, which the CI runners do not install.
ZoneInfo then refuses the alias, consent_region() fails closed, and the
Atlantic/Faeroe row (expected False) went red on every PR, develop included;
the three legacy rows expecting True passed for the wrong reason.

The mapping test now stubs the zone lookup, so every row checks the
name-to-region mapping on any machine. A separate test pins the fail-closed
behaviour for an alias the installed zone database cannot load.
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b6aa1700-f8fe-49c1-8d4f-015a355a6832
Commits

Reviewing files that changed from the base of the PR and between ca069fc and 9f356c9.

Files selected for processing: 1

  • tests/test_telemetry_notice.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant