Skip to content

test(files_sharing): build reminder expiry dates at test time - #67744

Open
susnux wants to merge 1 commit into
masterfrom
test/shares-reminder-midnight
Open

susnux wants to merge 1 commit into
masterfrom
test/shares-reminder-midnight

Conversation

@susnux

@susnux susnux commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

SharesReminderJobTest::testSharesReminder fails when a CI run crosses midnight UTC. The data provider builds the expiry dates when PHPUnit starts, so a run that starts at 23:54 and reaches this test after 00:00 gets:

  • "today" already in the past: the Share Manager throws Expiration date is in the past (8 errors)
  • "tomorrow" already today: a reminder is sent where none is expected (2 failures)

The provider now returns day offsets (null / 0 / 1) and the test builds the DateTime itself. The data rows are unchanged.

Seen on #63486 in Sharding - MySQL 8.4 and s3-multibucket-minio. PHPUnit started at 2026-12-05 23:54 UTC and the failures were reported after midnight.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

PHPUnit evaluates data providers before any test runs. When a suite
starts before midnight and SharesReminderJobTest runs after it, the
"today" expiry date is already in the past (the Share Manager rejects
the share) and the "tomorrow" one has become today (a reminder is sent),
so 10 data sets fail.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux added this to the Nextcloud 36 milestone Dec 6, 2026
@susnux susnux added feature: sharing tests Related to tests labels Dec 6, 2026
@susnux

susnux commented Dec 6, 2026

Copy link
Copy Markdown
Contributor Author

/backport to stable35

@susnux

susnux commented Dec 6, 2026

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@susnux

susnux commented Dec 6, 2026

Copy link
Copy Markdown
Contributor Author

/backport to stable33

@susnux
susnux marked this pull request as ready for review December 6, 2026 00:16
@susnux
susnux requested a review from a team as a code owner December 6, 2026 00:16
@susnux
susnux requested review from GhassenKefi, provokateurin, salmart-dev and vlotysh and removed request for a team December 6, 2026 00:16

This branch has not been deployed

No deployments
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