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

fix: fix flake due to two time.Now() calls#19450

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

Merged

Conversation

bcpeinhardt
Copy link
Contributor

@bcpeinhardtbcpeinhardt commentedAug 20, 2025
edited
Loading

fixescoder/internal#559

This test is looking to see that after callingcoder schedule extend <workspace> 10h, the scheduled stop time of the workspace is updated appropriately (or at least that the information printed to the terminal indicates that).

By using twotime.Now() calls for the current time and the expected time, there was the possibility that the second call just barely crossed over the hour mark. This is shown in the error message when the test would flake:wanted "2025-04-07T22:"; got " 2025-04-07T23:00:00+05:30 \r\n" (the 00:00 letting us know we just barely crossed the hour).

Using the same time object to construct the expected time should fix the issue.

@bcpeinhardtbcpeinhardt changed the titlefix(flake): expected time crossing hour boundary with two time.Now() callsfix(flake): fix expected time crossing hour boundary with two time.Now() callsAug 20, 2025
@bcpeinhardtbcpeinhardt changed the titlefix(flake): fix expected time crossing hour boundary with two time.Now() callsfix: fix flake where expected time is crossing the hour boundary due to two time.Now() callsAug 20, 2025
@bcpeinhardtbcpeinhardt changed the titlefix: fix flake where expected time is crossing the hour boundary due to two time.Now() callsfix: fix flake due to two time.Now() callsAug 20, 2025
now:=time.Now()
// To avoid the likelihood of time-related flakes, only matching up to the hour.
expectedDeadline:=time.Now().In(loc).Add(10*time.Hour).Format("2006-01-02T15:")
expectedDeadline:=now.In(loc).Add(10*time.Hour).Format("2006-01-02T15:")
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

The culprit

Copy link
Contributor

@f0sself0ssel left a comment

Choose a reason for hiding this comment

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

🕙

@bcpeinhardtbcpeinhardt merged commit02fc173 intomainAug 20, 2025
40 checks passed
@bcpeinhardtbcpeinhardt deleted the bcpeinhardt/TestSchecduleOverride/extend-flakefix branchAugust 20, 2025 17:12
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 20, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@f0sself0sself0ssel approved these changes

Assignees

@bcpeinhardtbcpeinhardt

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

flake: cliTestScheduleOverride/extend
2 participants
@bcpeinhardt@f0ssel

[8]ページ先頭

©2009-2025 Movatter.jp