Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix testUsernameChangeCostWindow setup #12062

Merged
merged 5 commits into from
Mar 31, 2025

Conversation

notbakaneko
Copy link
Collaborator

Use a known fixed number instead of while < $now

while (CarbonImmutable::now()->isBefore($now)) {
// every 6 months for 3 years = 6
// using isBefore to setup adds too many when run at month boundaries.
for ($i = 0; $i < 6; $i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

although it's not for another three years, there's a vaguely similar problem when run on feb 29

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it ironically works fine because usernameChangeCost doesn't check if the date is in the future

Copy link
Collaborator

@nanaya nanaya Mar 31, 2025

Choose a reason for hiding this comment

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

still failing with $now = CarbonImmutable::now()->subYears(1)->startOfMonth()->subDays(1);...

I guess it's more like something just doesn't use the carbon date...?

Nope, it's just $now isn't actually quite used everywhere relevant

@nanaya nanaya enabled auto-merge March 31, 2025 05:18
@nanaya nanaya merged commit 1103470 into ppy:master Mar 31, 2025
3 checks passed
@notbakaneko notbakaneko deleted the fix-username-cost-window-test branch April 1, 2025 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants