Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test: fix TestDescCacheTimestampUpdate flake#20975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ethanndickson wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromfix-desc-cache-timestamp-flake

Conversation

@ethanndickson
Copy link
Member

@ethanndicksonethanndickson commentedNov 28, 2025
edited
Loading

Problem

TestDescCacheTimestampUpdate was flaky on Windows CI becausetime.Now() has ~15.6ms resolution, causing consecutive calls to return identical timestamps.

Solution

Injectquartz.Clock intoMetricsAggregator using an options pattern, making the test deterministic by using a mock clock with explicit time advancement.

Changes

  • Addclock quartz.Clock field toMetricsAggregator struct
  • AddWithClock() option for dependency injection
  • Replace alltime.Now() calls withma.clock.Now()
  • Update test to use mock clock withmClock.Advance(time.Second)

This PR was fully generated bymux using Claude Opus 4.5, and reviewed by me.

Closescoder/internal#1146

TestDescCacheTimestampUpdate was flaky on Windows because time.Now()has ~15.6ms resolution, causing consecutive calls to return identicaltimestamps.Changes:- Add quartz.Clock field to MetricsAggregator with options pattern- Replace all time.Now() calls with clock.Now()- Use mock clock in test with explicit time advancement
@ethanndicksonethanndickson changed the titlefix(prometheusmetrics): use quartz.Clock to fix flaky timestamp testtest: fix TestDescCacheTimestampUpdate flakeNov 28, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@cstyancstyanAwaiting requested review from cstyan

At least 1 approving review is required to merge this pull request.

Assignees

@ethanndicksonethanndickson

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

flake: TestDescCacheTimestampUpdate

2 participants

@ethanndickson

[8]ページ先頭

©2009-2025 Movatter.jp