Skip to content

Make main green again: history stats tests at night, and one Pages deploy at a time - #2598

Merged
frenck merged 1 commit into
mainfrom
frenck/history-stats-test-clock
Dec 4, 2026
Merged

frenck merged 1 commit into
mainfrom
frenck/history-stats-test-clock

Conversation

@frenck

@frenck frenck commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Description

  • tests/ectoplasms/history_stats/services/test_set_period.py runs at noon on a fixed day (pytest.mark.freeze_time), instead of on the real clock.
  • The deploy job of the Documentation workflow waits in a pages concurrency group for the deploy before it.

Motivation and Context

Main is red twice over.

The history stats sensor in these tests counts from midnight (today_at()). The tests run on the real clock, in the tests' time zone, US/Pacific. Between 07:00 and 08:00 UTC it is past 23:00 there, so playing one hour crosses midnight and only the minutes before it count: 0.21 instead of 1.00. Red for that hour every night, green after it.

Since #2578 every commit on main gets a run of its own, so two of them can deploy the website at once. Pages refuses a second deployment while one runs.

How has this been tested?

The three failures reproduced locally inside that hour. With the fix, all 34 history stats tests pass in it. Frozen at 23:30 Pacific instead, the same three fail exactly as on CI, so the clock is the cause. zizmor finds nothing in the workflow.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I did not edit machine-translated files in documentation/translations/output/.

…ploy at a time

The history stats set_period tests count from midnight on the real clock. Run between 23:00 and midnight in the tests' time zone, playing an hour crosses midnight and the counts come out short. They now run at noon on a fixed day.

Since every commit on main gets a run of its own (#2578), two can deploy the website at once, and Pages refuses the second. The deploy job now waits for the one before it.
Copilot AI balanced review requested due to automatic review settings December 4, 2026 07:39
@frenck frenck added ci Work that improves the continue integration. maintenance Generic maintenance tasks. labels Dec 4, 2026
@coderabbitai

coderabbitai Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

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 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 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: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 654e152c-6041-44e2-b7a0-79b7886062c7
Commits

Reviewing files that changed from the base of the PR and between b32573a and 97b0182.

Files selected for processing: 2

  • .github/workflows/documentation.yaml
  • tests/ectoplasms/history_stats/services/test_set_period.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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the test-timing and deployment-concurrency changes.

No open issues 🎉

What changed in this PR

Stabilizes history stats tests and prevents overlapping website deployments following the CI changes in #2578.

Changes:

  • Freezes history stats tests at noon Pacific on a fixed day to avoid midnight-related failures.
  • Serializes Pages deployments without cancelling the active deployment.
File Description
tests/​ectoplasms/​history_stats/​services/​test_set_period.py Adds a module-wide frozen clock for deterministic tests.
.github/​workflows/​documentation.yaml Adds a shared pages concurrency group to the deploy job.

Review effort: Balanced

@frenck
frenck merged commit c2023f2 into main Dec 4, 2026
16 of 17 checks passed
@frenck
frenck deleted the frenck/history-stats-test-clock branch December 4, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Work that improves the continue integration. maintenance Generic maintenance tasks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants